agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6?
Date: Wed, 10 Oct 2012 16:00:20 -0700
Message-ID: <5075FE04.4020407@hogranch.com> (raw)
In-Reply-To: <5075C9D9.9080303@ejurka.com>
References: <50651F8A.1080704@hogranch.com>
	<50660523.5050503@hogranch.com>
	<50660A90.3020308@hogranch.com>
	<5069E7C8.4090004@hogranch.com>
	<5073DEED.8030504@hogranch.com>
	<507472B6.3060100@hogranch.com>
	<507474C0.1010304@hogranch.com>
	<50749A49.8060003@hogranch.com>
	<5075C351.1010101@hogranch.com>
	<5075C9D9.9080303@ejurka.com>

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





view thread (17+ messages)  latest in thread

Message-ID: <5075FE04.4020407@hogranch.com>
Permalink:  ../5075FE04.4020407@hogranch.com/
Also on:    postgresql.org/message-id/5075FE04.4020407@hogranch.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] pljava on AIX for postgres 9.1.x and IBM AIX Java 6?
  In-Reply-To: <5075FE04.4020407@hogranch.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox