Lists: | PostgreSQL : PostgreSQL 메일 링리스트 : 2012-09-28 20:14 이후 토토 베이. |
---|
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-09-28 03:54:50 |
Message-ID: | 50651F8A.1080704@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
has anyone built pljava for AIX on Power6/7 for postgres 9.1.x with IBM
Java 6 ?
I've been tasked with getting this running asap for our production folks
who want to deploy yesterday. I'm assuming I should start with the
latest snapshot on pgfoundry ?
http://pgfoundry.org/frs/download.php/3280/pljava-src-snapshot.20120525.0.tar.gz
our postgres is built with IBM XL C, so I assume I should use this for
building the pljava.so linkage rather than gcc.
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-09-28 20:14:27 |
Message-ID: | 50660523.5050503@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | PostgreSQL : PostgreSQL 메일 링리스트 : 2012-09-28 20:14 이후 토토 베이. |
On 09/27/12 8:54 PM, John R Pierce wrote:
> has anyone built pljava for AIX on Power6/7 for postgres 9.1.x with
> IBM Java 6 ?
>
> I've been tasked with getting this running asap for our production
> folks who want to deploy yesterday. I'm assuming I should start
> with the latest snapshot on pgfoundry ?
> http://pgfoundry.org/frs/download.php/3280/pljava-src-snapshot.20120525.0.tar.gz
>
>
> our postgres is built with IBM XL C, so I assume I should use this for
> building the pljava.so linkage rather than gcc.
>
and attempt 1.0 has failed and I dunno why.
build related environment:
OBJECT_MODE=64
PATH=/usr/java6_64/bin:/usr/vac/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/postgres/bin:/usr/bin/X11:/sbin:/opt/pgsql91/bin
PWD=/home/postgres/src/pljava-snapshot.20120525.0
JAVA_HOME=/usr/java6_64
PGDATA=/u01/pgsql91/data
CC=/usr/vac/bin/xlc
$ gmake
gmake[1]: Entering directory
`/home/postgres/src/pljava-snapshot.20120525.0/build/classes/pljava'
gmake[1]: *** virtual memory exhausted. Stop.
gmake[1]: Leaving directory
`/home/postgres/src/pljava-snapshot.20120525.0/build/classes/pljava'
gmake: *** [pljava_all] Error 2
$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap6460sr5-20090529_04(SR5))
IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 AIX ppc64-64
jvmap6460sr5-20090519_35743 (JIT enabled, AOT enabled)
J9VM - 20090519_035743_BHdSMr
JIT - r9_20090518_2017
GC - 20090417_AA)
JCL - 20090529_01
yikes, I don't even know where to start. ./build/classes/pljava is empty.
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-09-28 20:37:36 |
Message-ID: | 50660A90.3020308@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 09/28/12 1:14 PM, John R Pierce wrote:
> and attempt 1.0 has failed and I dunno why.
attempt 1.1 (with pljava-1.4.3 instead of the snapshot) gives me...
$ pwd
/home/postgres/src/pljava-1.4.3
$ gmake
Makefile:51: *** PL/Java 1.4.3 can only be compiled with JDK 1.4 or
1.5. Stop.
:-/
and attempt 1.2...
$ export PATH=/usr/java5_64/bin:/usr/vac/bin:/usr/bin:/opt/pgsql91/bin
$ export JAVA_HOME=/usr/java5_64
$ gmake
Makefile:51: *** PL/Java 1.4.3 can only be compiled with JDK 1.4 or
1.5. Stop.
$ java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build
pap64devifx-20110211c (SR12 FP3 +IZ94331))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc64-64
j9vmap6423ifx-20101130 (JIT enabled)
J9VM - 20101129_69669_BHdSMr
JIT - 20100623_16197ifx1_r8
GC - 20100211_AA)
JCL - 20110208
**MEH**
now what? there is no sun/oracle JAVA on IBM AIX, only IBM Java.
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-01 18:58:16 |
Message-ID: | 5069E7C8.4090004@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 09/28/12 1:37 PM, John R Pierce wrote:
> $ export PATH=/usr/java5_64/bin:/usr/vac/bin:/usr/bin:/opt/pgsql91/bin
> $ export JAVA_HOME=/usr/java5_64
> $ gmake
> Makefile:51: *** PL/Java 1.4.3 can only be compiled with JDK 1.4 or
> 1.5. Stop.
>
> $ java -version
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build
> pap64devifx-20110211c (SR12 FP3 +IZ94331))
> IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc64-64
> j9vmap6423ifx-20101130 (JIT enabled)
> J9VM - 20101129_69669_BHdSMr
> JIT - 20100623_16197ifx1_r8
> GC - 20100211_AA)
> JCL - 20110208,
so I disabled this test in the master Makefile, and now I get....
$ gmake
gmake[1]: Entering directory
`/home/postgres/src/pljava-1.4.3/build/classes/pljava'
gmake[1]: *** virtual memory exhausted. Stop.
gmake[1]: Leaving directory
`/home/postgres/src/pljava-1.4.3/build/classes/pljava'
gmake: *** [pljava_all] Error 2
if I try gmake c_all, I get errors for missing .h files from the java
side... I don't see these files in the build tree, so I'm assuming they
get built?
$ gmake c_all
gmake[1]: Entering directory `/home/postgres/src/pljava-1.4.3/build/objs'
/home/postgres/src/pljava-1.4.3/src/C/pljava/Makefile:232: warning:
overriding commands for target `pljava.so'
/opt/pgsql91/lib/pgxs/src/makefiles/../../src/Makefile.shlib:387:
warning: ignoring old commands for target `pljava.so'
/usr/vacpp/bin/xlc -c -q64 -I/home/postgres/src/include -O2 -qarch=pwr5
-qtune=balanced -qnoansialias -I. -I. -I/opt/pgsql91/include/server
-I/opt/pgsql91/include/internal -DPKGLIBDIR=\"/opt/pgsql91/lib\"
-I/home/postgres/src/pljava-1.4.3/src/C/include
-I/home/postgres/src/pljava-1.4.3/build/jni -DPGSQL_MAJOR_VER=9
-DPGSQL_MINOR_VER=1 -DPGSQL_PATCH_VER=6 -I"/usr/java5_64/include"
-I"/usr/java5_64/include/aix"
/home/postgres/src/pljava-1.4.3/src/C/pljava/Backend.c -o Backend.o
"/home/postgres/src/pljava-1.4.3/src/C/pljava/Backend.c", line 30.10:
1506-296 (S) #include file "org_postgresql_pljava_internal_Backend.h"
not found.
"/home/postgres/src/pljava-1.4.3/src/C/pljava/Backend.c", line 106.17:
1506-045 (S) Undeclared identifier
Java_org_postgresql_pljava_internal_Backend_isCallingJava.
"/home/postgres/src/pljava-1.4.3/src/C/pljava/Backend.c", line 111.17:
1506-045 (S) Undeclared identifier
Java_org_postgresql_pljava_internal_Backend_isReleaseLingeringSavepoints.
"/home/postgres/src/pljava-1.4.3/src/C/pljava/Backend.c", line 116.17:
1506-045 (S) Undeclared identifier
Java_org_postgresql_pljava_internal_Backend__1getConfigOption.
"/home/postgres/src/pljava-1.4.3/src/C/pljava/Backend.c", line 121.17:
1506-045 (S) Undeclared identifier
Java_org_postgresql_pljava_internal_Backend__1getStatementCacheSize.
"/home/postgres/src/pljava-1.4.3/src/C/pljava/Backend.c", line 126.17:
1506-045 (S) Undeclared identifier
Java_org_postgresql_pljava_internal_Backend__1log.
"/home/postgres/src/pljava-1.4.3/src/C/pljava/Backend.c", line 131.17:
1506-045 (S) Undeclared identifier
Java_org_postgresql_pljava_internal_Backend__1clearFunctionCache.
gmake[1]: *** [Backend.o] Error 1
gmake[1]: Leaving directory `/home/postgres/src/pljava-1.4.3/build/objs'
gmake: *** [c_all] Error 2
is there anyone out here, or am I talking to a dead list?
\
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-09 08:23:09 |
Message-ID: | 5073DEED.8030504@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/01/12 11:58 AM, John R Pierce wrote:
> (Various attempts at building pljava on AIX 6.1 with IBM XLC and IBM
> Java 1.5_64 enumerated)
> $ gmake
> gmake[1]: Entering directory
> `/home/postgres/src/pljava-1.4.3/build/classes/pljava'
> gmake[1]: *** virtual memory exhausted. Stop.
> gmake[1]: Leaving directory
> `/home/postgres/src/pljava-1.4.3/build/classes/pljava'
> gmake: *** [pljava_all] Error 2
>
> if I try gmake c_all, I get errors for missing .h files from the java
> side... I don't see these files in the build tree, so I'm assuming
> they get built?
I returned to this project tonight... I build pljava from the 1.4.3
sources on a Linux platform, tarred up the ./build subdirectory after
deleting the .o and .so files, and untarred this on the AIX build. I
ran gmake c_all there, and got all the way to ...
/usr/bin/ar crs libpljava.a Backend.o Exception.o ExecutionPlan.o
Function.o HashMap.o Invocation.o Iterator.o JNICalls.o PgObject.o
PgSavepoint.o SPI.o SQLInputFromChunk.o SQLInputFromTuple.o
SQLOutputToChunk.o SQLOutputToTuple.o Session.o SubXactListener.o
XactListener.o backports.o type/AclId.o type/Any.o type/Array.o
type/BigDecimal.o type/Boolean.o type/Byte.o type/Coerce.o
type/Composite.o type/Date.o type/Double.o type/ErrorData.o
type/Float.o type/HeapTupleHeader.o type/Integer.o
type/JavaWrapper.o type/LargeObject.o type/Long.o type/Oid.o
type/Portal.o type/Relation.o type/Short.o type/String.o type/Time.o
type/Timestamp.o type/TriggerData.o type/Tuple.o type/TupleDesc.o
type/TupleTable.o type/Type.o type/UDT.o type/Void.o type/byte_array.o
touch libpljava.a
/opt/pgsql91/lib/pgxs/src/makefiles/../../src/backend/port/aix/mkldexport.sh
libpljava.a >libpljava.exp
/bin/sh:
/opt/pgsql91/lib/pgxs/src/makefiles/../../src/backend/port/aix/mkldexport.sh:
not found.
gmake[1]: *** [libpljava.a] Error 127
gmake[1]: *** Deleting file `libpljava.a'
gmake[1]: Leaving directory `/home/postgres/src/pljava-1.4.3/build/objs'
gmake: *** [c_all] Error 2
now, my Postgresql build has that lib/pgxs/src/makefiles directory but
it does NOT have lib/pgxs/src/backend so I presume I did something wrong
building 9.1.6 ?
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-09 18:53:42 |
Message-ID: | 507472B6.3060100@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/09/12 1:23 AM, John R Pierce wrote:
> /opt/pgsql91/lib/pgxs/src/makefiles/../../src/backend/port/aix/mkldexport.sh:
>
> not found.
ok, I found this file in the 9.1.6 source tree I built, so I manually
moved it over to the postgres install directory, and now the pljava make
bombs at...
....
/usr/vacpp/bin/xlc -q64 -I/home/postgres/src/include -O2 -qarch=pwr5
-qtune=balanced -qnoansialias -o pljava.so libpljava.a
-Wl,-bE:libpljava.exp -L/opt/pgsql91/lib -L/home/postgres/src/lib
-Wl,-blibpath:'/opt/pgsql91/lib:/opt/pgsql91/lib:/home/postgres/src/lib:/usr/lib:/lib'
-Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE
-Wl,-bI:/opt/pgsql91/bin/postgres/postgres.imp -L.
-L"/usr/java5_64/jre/bin/j9vm" -ljvm
ld: 0706-003 Cannot find or read import file:
/opt/pgsql91/bin/postgres/postgres.imp
ld:accessx(): A parameter must be a directory.
so thats /another/ missing file... hmmm, a file of that name is in lib,
not bin/postgres ...
$ find . -name postgres.imp
./src/backend/postgres.imp
$ find /opt/pgsql91 -name postgres.imp
/opt/pgsql91/lib/postgres.imp
and, muh-oh... $PG_PREFIX/bin/postgres is the binary executable, so I
*can't* put a copy of postgres.imp there, hah. and a bit of poking
around the pljava makefiles, I'm not figuring out how its cooking that
path name up?!?
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-09 19:02:24 |
Message-ID: | 507474C0.1010304@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/09/12 11:53 AM, John R Pierce wrote:
> and, muh-oh... $PG_PREFIX/bin/postgres is the binary executable, so
> I *can't* put a copy of postgres.imp there, hah. and a bit of poking
> around the pljava makefiles, I'm not figuring out how its cooking that
> path name up?!?
actually, it appears to be another issue on the PGXS side of postgres on
AIX.
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-09 21:42:33 |
Message-ID: | 50749A49.8060003@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/09/12 12:02 PM, John R Pierce wrote:
> On 10/09/12 11:53 AM, John R Pierce wrote:
>> and, muh-oh... $PG_PREFIX/bin/postgres is the binary executable, so
>> I *can't* put a copy of postgres.imp there, hah. and a bit of
>> poking around the pljava makefiles, I'm not figuring out how its
>> cooking that path name up?!?
>
> actually, it appears to be another issue on the PGXS side of postgres
> on AIX.
ok, to follow up... after manually copying
src/backend/port/aix/mkldexport.sh from the postgresql 9.1.6 source tree
to the installation directory (under lib/pgxs), we then found...
in postgres 9.1.6, at least, the pkgxs/src/makefiles/Makefile.aix is
broken, it needs this change...
from:
BE_DLLLIBS= -Wl,-bI:$(bindir)/postgres/$(POSTGRES_IMP)
to:
BE_DLLLIBS= -Wl,-bI:$(pkglibdir)/$(POSTGRES_IMP)
and... in pljava, I had to...
export PLJAVA_LDFLAGS=-lm
before I ran gmake c_all
now its built, but still untested....
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-10 18:49:53 |
Message-ID: | 5075C351.1010101@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/09/12 2:42 PM, John R Pierce wrote:
>
> now its built, but still untested....
man, this has been an uphill battle. the large bulge on my forehead
from banging my head against the desk is becoming unseemly.
$ ls -l
total 0
-rw-r--r-- 1 postgres staff 5470 Oct 10 11:41 deploy.jar
-rw-r--r-- 1 postgres staff 47441 Oct 10 11:41 examples.jar
-rw-r--r-- 1 postgres staff 156110 Oct 08 22:42 pljava.jar
-rwxr-xr-x 1 postgres staff 87723 Oct 09 14:34 pljava.so
-rw-r--r-- 1 postgres staff 548226 Oct 01 05:57
postgresql-9.1-903.jdbc3.jar
$ java -cp deploy.jar:postgresql-9.1-903.jdbc3.jar
org.postgresql.pljava.deploy.Deployer -install
Exception in thread "main" java.lang.UnsupportedClassVersionError:
(org/postgresql/Driver) bad major version at offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:267)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:600)
at java.net.URLClassLoader.access$400(URLClassLoader.java:124)
at
java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1055)
at
java.security.AccessController.doPrivileged(AccessController.java:274)
at java.net.URLClassLoader.findClass(URLClassLoader.java:492)
at java.lang.ClassLoader.loadClass(ClassLoader.java:640)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:606)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:130)
at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:238)
$ java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build
pap64devifx-20110211c (SR12 FP3 +IZ94331))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc64-64
j9vmap6423ifx-20101130 (JIT enabled)
J9VM - 20101129_69669_BHdSMr
JIT - 20100623_16197ifx1_r8
GC - 20100211_AA)
JCL - 20110208
$ psql
psql (9.1.6)
Type "help" for help.
postgres=# select version();
version
------------------------------------------------------------------------------------
PostgreSQL 9.1.6 on powerpc-ibm-aix6.1.0.0, compiled by
/usr/vacpp/bin/xlc, 64-bit
(1 row)
Is that complaining that the JDBC driver is the wrong version?
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | books at ejurka(dot)com (Kris Jurka) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-10 19:17:45 |
Message-ID: | 5075C9D9.9080303@ejurka.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/10/2012 11:49 AM, John R Pierce wrote:
> $ java -cp deploy.jar:postgresql-9.1-903.jdbc3.jar
> org.postgresql.pljava.deploy.Deployer -install
> Exception in thread "main" java.lang.UnsupportedClassVersionError:
> (org/postgresql/Driver) bad major version at offset=6
>
> Is that complaining that the JDBC driver is the wrong version?
>
Yes, the latest release of the JDBC drivers were botched and built with
the wrong java version. I don't know what the status of a fix for that
is, but you should be able to run the deployer with Java6 to install
pljava for a different java version because the deployer is all client
side and has nothing to do with the server jvm.
Kris Jurka
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-10 23:00:20 |
Message-ID: | 5075FE04.4020407@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/10/12 12:17 PM, Kris Jurka wrote:
> Yes, the latest release of the JDBC drivers were botched and built
> with the wrong java version. I don't know what the status of a fix
> for that is, but you should be able to run the deployer with Java6 to
> install pljava for a different java version because the deployer is
> all client side and has nothing to do with the server jvm.
*OUCH* ... we have a LOT of legacy stuff running on 1.5 but
hoookay.... switched to jdbc4 and jdk6 for the deployer...
$ /usr/java6_64/bin/java -cp deploy.jar:postgresql-9.2-1000.jdbc4.jar
org.postgresql.pljava.deploy.Deployer -install -host 127.0.0.1 -port
5432 -user postgres -password go_team
org.postgresql.util.PSQLException: ERROR: could not load library
"/opt/XXX/pljava/pljava.so": Could not load module
/opt/XXX/pljava/pljava.so.
Dependent module libpljava.a(pljava.so) could not be loaded.
Could not load module libpljava.a(pljava.so).
System error: No such file or directory
Could not load module /opt/XXX/pljava/pljava.so.
Dependent module /opt/XXX/pljava/pljava.so could not be loaded.
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:395)
at
org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474)
at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269)
and this is in the postgres log file...
2012-10-10 14:26:43 PDT postgres at 127.0.0.1[postgres|27853020]: ERROR:
could not load library "/opt/XXX/pljava/pljava.so": Could not load
module /opt/XXX/pljava/pljava.so.
Dependent module libpljava.a(pljava.so) could not be
loaded.
Could not load module libpljava.a(pljava.so).
System error: No such file or directory
Could not load module /opt/XXXpljava/pljava.so.
Dependent module /opt/XXX/pljava/pljava.so could not be
loaded.
2012-10-10 14:26:43 PDT postgres at 127.0.0.1[postgres|27853020]:
STATEMENT: CREATE FUNCTION sqlj.java_call_handler() RETURNS
language_handler AS 'pljava' LANGUAGE C
2012-10-10 14:26:43 PDT postgres at 127.0.0.1[postgres|27853020]: LOG:
unexpected EOF on client connection
$ ldd pljava.so
pljava.so needs:
/usr/lib/libc.a(shr_64.o)
Cannot find libpljava.a(pljava.so)
/usr/java5_64/jre/bin/j9vm/libjvm.a
/unix
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libc_r.a(shr_64.o)
/usr/lib/libpthread.a(shr_xpg5_64.o)
Cannot find libjsig.so
Cannot find libj9thr23.so
yet....
$ echo $LD_LIBRARY_PATH
/opt/XXX/pljava:/usr/java5_64/jre/bin:/opt/pgsql91/lib
$ find /usr/java5_64 -name libjsig.so -o -name libj9thr23.so
/usr/java5_64/jre/bin/libj9thr23.so
/usr/java5_64/jre/bin/libjsig.so
and here's the init.d script I used to postgres to setup the library
path and stuff...
# cat /etc/rc.d/init.d/postgres91
#!/usr/bin/ksh
# simple postgres sysVinit script
#
# Make sure that /opt and pgdata is mounted
#####################################
[ ! -d /opt/pgsql91 ] && exit 1
[ ! -d /u01/pgsql91 ] && exit 1
export PATH=/usr/bin:/opt/pgsql91/bin
export PGDATA=/u01/pgsql91/data
#### pljava stuff...
export JAVA_HOME=/usr/java5_64
export
LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/ppc64:/opt/XXX/pljava:/opt/pgsql91/lib
export PATH=$PATH:$JAVA_HOME/bin
###
su postgres -c "pg_ctl $1"
and, all my components are in that /opt/XXX/pljava directory, including
the .so I built.
$ pwd
/opt/XXX/pljava
$ ls -l
total 0
-rw-r--r-- 1 postgres staff 5470 Oct 10 11:41 deploy.jar
-rw-r--r-- 1 postgres staff 47441 Oct 10 11:41 examples.jar
-rw-r--r-- 1 postgres staff 156110 Oct 08 22:42 pljava.jar
-rwxr-xr-x 1 postgres staff 87723 Oct 09 14:34 pljava.so
-rw-r--r-- 1 postgres staff 548226 Oct 01 05:57
postgresql-9.1-903.jdbc3.jar
-rw-r--r-- 1 postgres staff 578823 Sep 27 07:51
postgresql-9.2-1000.jdbc4.jar
and, here's whats in postgresql.conf...
$ tail /u01/pgsql91/data/postgresql.conf
#------------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#------------------------------------------------------------------------------
#custom_variable_classes = '' # list of custom variable class
names
dynamic_library_path = '$libdir:/opt/XXX/pljava:/usr/java5_64/jre/bin'
custom_variable_classes = 'pljava'
pljava.classpath = '/opt/XXX/pljava/pljava.jar'
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-11 23:58:00 |
Message-ID: | 50775D08.9030409@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/10/12 4:00 PM, John R Pierce wrote:
> $ echo $LD_LIBRARY_PATH
> /opt/XXX/pljava:/usr/java5_64/jre/bin:/opt/pgsql91/lib
slight progress here, its LIBPATH not LD_LIBRARY_PATH on AIX. sheesh.
still stuck on ....
$ /usr/java6_64/bin/java -cp deploy.jar:postgresql-9.2-1000.jdbc4.jar
org.postgresql.pljava.deploy.Deployer -install -host 127.0.0.1 -port
5432 -user postgres -password XXXX
org.postgresql.util.PSQLException: ERROR: could not load library
"/opt/XXX/pljava/pljava.so": Could not load module
/opt/XXX/pljava/pljava.so.
Dependent module libpljava.a(pljava.so) could not be loaded.
Could not load module libpljava.a(pljava.so).
System error: No such file or directory
Could not load module /opt/XXX/pljava/pljava.so.
Dependent module /opt/XXX/pljava/pljava.so could not be loaded.
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:395)
at
org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474)
at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269)
$ echo $LIBPATH
/opt/XXX:/usr/java5_64/jre/bin
$ ldd pljava.so
pljava.so needs:
/usr/lib/libc.a(shr_64.o)
Cannot find libpljava.a(pljava.so)
/usr/java5_64/jre/bin/j9vm/libjvm.a
/unix
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libc_r.a(shr_64.o)
/usr/lib/libpthread.a(shr_xpg5_64.o)
/usr/java5_64/jre/bin/libjsig.so
/usr/java5_64/jre/bin/libj9thr23.so
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | books at ejurka(dot)com (Kris Jurka) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-12 00:36:59 |
Message-ID: | 5077662B.2000607@ejurka.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/11/2012 4:58 PM, John R Pierce wrote:
>
> still stuck on ....
>
> $ /usr/java6_64/bin/java -cp deploy.jar:postgresql-9.2-1000.jdbc4.jar
> org.postgresql.pljava.deploy.Deployer -install -host 127.0.0.1 -port
> 5432 -user postgres -password XXXX
> org.postgresql.util.PSQLException: ERROR: could not load library
> "/opt/XXX/pljava/pljava.so": Could not load module
> /opt/XXX/pljava/pljava.so.
> Dependent module libpljava.a(pljava.so) could not be loaded.
Is there a libpljava.a in your build tree that didn't get installed? If
so you could try copying it over to where pljava.so is located.
Kris Jurka
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-12 00:49:40 |
Message-ID: | 50776924.6080504@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/11/12 5:36 PM, Kris Jurka wrote:
> Is there a libpljava.a in your build tree that didn't get installed?
> If so you could try copying it over to where pljava.so is located.
libpljava.a is built en route to building pljava.so... in fact,
pljava.so is pretty much libpljava.a ld'd into a .so
here's the pljava link related commands that built this, and some output
from various tools...
link commands...
/usr/vacpp/bin/xlc -q64 -I/home/postgres/src/include -O2 -qarch=pwr5 -qtune=balanced -qnoansialias -o pljava.so libpljava.a -Wl,-bE:libpljava.exp -L/opt/pgsql91/lib -L/home/postgres/src/lib -Wl,-blibpath:'/opt/pgsql91/lib:/opt/pgsql91/lib:/home/postgres/src/lib:/usr/lib:/lib' -Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE -Wl,-bI:/opt/pgsql91/lib/postgres.imp -L. -L"/usr/java5_64/jre/bin/j9vm" -ljvm -lm
rm -f libpljava.a
/usr/bin/ar crs libpljava.a pljava.so
/opt/pgsql91/lib/pgxs/src/makefiles/../../src/backend/port/aix/mkldexport.sh libpljava.a > pljava
/usr/vacpp/bin/xlc -q64 -I/home/postgres/src/include -O2 -qarch=pwr5 -qtune=balanced -qnoansialias -Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE -o pljava.so libpljava.a -Wl,-bE:pljava -Wl,-bI:/opt/pgsql91/lib/postgres.imp -L. -L"/usr/java5_64/jre/bin/j9vm" -ljvm -lm
result:
$ dump -X64 -H build/objs/pljava.so |more
build/objs/pljava.so:
***Loader Section***
Loader Header Information
VERSION# #SYMtableENT #RELOCent LENidSTR
0x00000001 0x00000027 0x00000000 0x00000051
#IMPfilID OFFidSTR LENstrTBL OFFstrTBL
0x00000002 0x000003e0 0x000001ea 0x00000431
***Import File Strings***
INDEX PATH BASE MEMBER
0 .:/usr/java5_64/jre/bin/j9vm:/usr/vac/lib:/usr/lib:/lib
1 libpljava.a pljava.so
And, when I copy it to its intended location, which is in my $LIBPATH try and load it, I get...
$ ldd /opt/xxx/pljava/pljava.so
/opt/xxx/pljava/pljava.so needs:
/usr/lib/libc.a(shr_64.o)
Cannot find libpljava.a(pljava.so)
/usr/java5_64/jre/bin/j9vm/libjvm.a
/unix
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libc_r.a(shr_64.o)
/usr/lib/libpthread.a(shr_xpg5_64.o)
/usr/java5_64/jre/bin/libjsig.so
/usr/java5_64/jre/bin/libj9thr23.so
$ echo $LIBPATH
/opt/xxx/pljava:/usr/java5_64/jre/bin whaaaaaa???
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-12 02:15:13 |
Message-ID: | 50777D31.70707@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/11/12 5:49 PM, John R Pierce wrote:
> On 10/11/12 5:36 PM, Kris Jurka wrote:
>> Is there a libpljava.a in your build tree that didn't get installed?
>> If so you could try copying it over to where pljava.so is located.
>
>
> libpljava.a is built en route to building pljava.so... in fact,
> pljava.so is pretty much libpljava.a ld'd into a .so
and... oh wow. I thought .a files were just used at link time?!?
anyways, yeah, I copied it to the target too, and now the deployer runs.
so...
$ psql -c "SELECT
sqlj.install_jar('file:///opt/xxx/pljava/examples.jar', 'samples', true);"
INFO: JVMJ9VM011W Unable to load jclscar_23: No such file or directory
ERROR: Failed to create Java VM
$ find /usr/java5_64 -name \*jclscar_23\*
/usr/java5_64/jre/bin/libjclscar_23.so
hoookay.... in my postgres server init.d script, I have...
export PATH=/usr/bin:/opt/pgsql91/bin
export PGDATA=/u01/pgsql91/data
#### pljava stuff...
export JAVA_HOME=/usr/java5_64
export
LIBPATH=$JAVA_HOME/jre/lib/ppc64:$JAVA_HOME/jre/bin:/opt/xxx/pljava:/opt/pgsql91/lib
export PATH=$PATH:$JAVA_HOME/bin
and, in my postgresql.conf I have...
dynamic_library_path = '$libdir:/opt/xxx/pljava:/usr/java5_64/jre/bin'
custom_variable_classes = 'pljava'
pljava.classpath = '/opt/xxx/pljava/pljava.jar'
color me stumped.... again.
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-12 21:06:56 |
Message-ID: | 50788670.3060903@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/11/12 7:15 PM, John R Pierce wrote:
> $ psql -c "SELECT
> sqlj.install_jar('file:///opt/xxx/pljava/examples.jar', 'samples',
> true);"
> INFO: JVMJ9VM011W Unable to load jclscar_23: No such file or directory
> ERROR: Failed to create Java VM
>
> $ find /usr/java5_64 -name \*jclscar_23\*
> /usr/java5_64/jre/bin/libjclscar_23.so
again, I'm using the pljava-1.4.3 source tarball, and I'm only doing the
`gmail c_all` part.
can someone familiar with the Makefiles of pljava explain why the .so is
apparently being built twice ? I've browsed the Makefile and frankly
find it fairly confusing.
if I delete build/objs/*.{o,a,so) and run gmake c_all...
$ export
PATH=/usr/java5_64/jre/bin:/usr/java5_64/bin:/usr/bin:/opt/pgsql91/bin
$ export JAVA_HOME=/usr/java5_64
$ export OBJECT_MODE=64
$ export PLJAVA_LDFLAGS=-lm
$ gmake c_all
...lots of compiles omitted....
/usr/bin/ar crs libpljava.a Backend.o Exception.o ExecutionPlan.o
Function.o HashMap.o Invocation.o Iterator.o JNICalls.o PgObject.o
PgSavepoint.o SPI.o SQLInputFromChunk.o SQLInputFromTuple.o
SQLOutputToChunk.o SQLOutputToTuple.o Session.o SubXactListener.o
XactListener.o backports.o type/AclId.o type/Any.o type/Array.o
type/BigDecimal.o type/Boolean.o type/Byte.o type/Coerce.o
type/Composite.o type/Date.o type/Double.o type/ErrorData.o type/Float.o
type/HeapTupleHeader.o type/Integer.o type/JavaWrapper.o
type/LargeObject.o type/Long.o type/Oid.o type/Portal.o type/Relation.o
type/Short.o type/String.o type/Time.o type/Timestamp.o
type/TriggerData.o type/Tuple.o type/TupleDesc.o type/TupleTable.o
type/Type.o type/UDT.o type/Void.o type/byte_array.o
touch libpljava.a
/opt/pgsql91/lib/pgxs/src/makefiles/../../src/backend/port/aix/mkldexport.sh
libpljava.a >libpljava.exp
/usr/vacpp/bin/xlc -q64 -I/home/postgres/src/include -O2 -qarch=pwr5
-qtune=balanced -qnoansialias -o pljava.so libpljava.a
-Wl,-bE:libpljava.exp -L/opt/pgsql91/lib -L/home/postgres/src/lib
-Wl,-blibpath:'/opt/pgsql91/lib:/opt/pgsql91/lib:/home/postgres/src/lib:/usr/lib:/lib'
-Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE
-Wl,-bI:/opt/pgsql91/lib/postgres.imp -L. -L"/usr/java5_64/jre/bin/j9vm"
-ljvm -lm
rm -f libpljava.a
/usr/bin/ar crs libpljava.a pljava.so
/opt/pgsql91/lib/pgxs/src/makefiles/../../src/backend/port/aix/mkldexport.sh
libpljava.a > pljava
/usr/vacpp/bin/xlc -q64 -I/home/postgres/src/include -O2 -qarch=pwr5
-qtune=balanced -qnoansialias -Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE -o
pljava.so libpljava.a -Wl,-bE:pljava
-Wl,-bI:/opt/pgsql91/lib/postgres.imp -L. -L"/usr/java5_64/jre/bin/j9vm"
-ljvm -lm
gmake[1]: Leaving directory `/home/postgres/src/pljava-1.4.3/build/objs'
$
I added blank lines to separate out the commands.
anyways, after building this, and putting both libpljava.a and pljava.so
into my designated runtime directory, I can run the deployer, and it
apparently works....
postgres=# \dL+
List of languages
Name | Owner | Trusted | Internal Language | Call
Handler | Validator | Inline Handler
| Access privileges
---------+----------+---------+-------------------+---------------------------+------------------------+----------------------------
------+-------------------
java | postgres | t | f |
sqlj.java_call_handler() | - | -
|
javau | postgres | f | f |
sqlj.javau_call_handler() | - | -
|
plpgsql | postgres | t | f |
plpgsql_call_handler() | plpgsql_validator(oid) |
plpgsql_inline_handler(inte
rnal) |
(3 rows)
Yet, with the proper LIBPATH defined and dynamic_library_path for good
measure, when I try and load the example.jar, I'm still getting..
postgres=# SELECT
sqlj.install_jar('file:///opt/xxx/pljava/examples.jar', 'samples', true);
INFO: JVMJ9VM011W Unable to load jclscar_23: No such file or directory
ERROR: Failed to create Java VM
postgres=# show dynamic_library_path ;
dynamic_library_path
-------------------------------------------------------
$libdir:/opt/xxx/pljava:/usr/java5_64/jre/bin
(1 row)
but I see...
$ ls -l /usr/java5_64/jre/bin/libjclscar_23.so
-r-xr-xr-x 1 bin bin 1278830 Dec 15 2010
/usr/java5_64/jre/bin/libjclscar_23.so
yet, my pljava.so seemingly loads fine...
$ echo $LIBPATH
/opt/xxx/pljava:/usr/java5_64/jre/bin
$ ldd /opt/xxx/pljava/pljava.so
/opt/xxx/pljava/pljava.so needs:
/usr/lib/libc.a(shr_64.o)
/opt/xxx/pljava/libpljava.a(pljava.so)
/usr/java5_64/jre/bin/j9vm/libjvm.a
/unix
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libc_r.a(shr_64.o)
/usr/lib/libpthread.a(shr_xpg5_64.o)
/usr/java5_64/jre/bin/libjsig.so
/usr/java5_64/jre/bin/libj9thr23.so
so I'm stuck here. again.
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
From: | pierce at hogranch(dot)com (John R Pierce) |
---|---|
To: | |
Subject: | [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6? |
Date: | 2012-10-13 01:46:47 |
Message-ID: | 5078C807.5020502@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
On 10/11/12 7:15 PM, John R Pierce wrote:
> $ psql -c "SELECT
> sqlj.install_jar('file:///opt/xxx/pljava/examples.jar', 'samples',
> true);"
> INFO: JVMJ9VM011W Unable to load jclscar_23: No such file or directory
> ERROR: Failed to create Java VM
and adding $JAVA_HOME/jre/bin/j9vm to the LIBPATH seems to have fixed
this. error message was misleading, when I did an `ldd` on that
libjclscar_32.so, it turned out the error was...
$ ldd /usr/java5_64/jre/bin/libjclscar_23.so
/usr/java5_64/jre/bin/libjclscar_23.so needs:
../lib/libc_r.a(shr_64.o)
../lib/libpthread.a(shr_xpg5_64.o)
/usr/java5_64/jre/bin/libjsig.so
/usr/java5_64/jre/bin/libj9zlib23.so
/usr/java5_64/jre/bin/libj9thr23.so
Cannot find libjvm.so
/unix
../lib/libcrypt.a(shr_64.o)
../lib/libc.a(shr_64.o)
and that libjvm.so is in $JAVA_HOME/jre/bin/j9vm
and yes, after sorting this out, holycow, its working, and I think the
test.jar passes all tests.
phew, what a long strange trip THIS has been.
--
john r pierce N 37, W 122
santa cruz ca mid-left coast