[Pljava-dev] Problems compiling under Mac OS X

Thomas Hallgren thhal at mailblocks.com
Sat May 15 10:28:37 UTC 2004


p3consulting wrote:

> Thomas,
>
> I think what could be the easiest is an independant shell script 
> (triggered by make test) doing some automated testing (creating a new 
> database, the tables, filling with some data, etc.) to see if 
> everything is ok.

I agree. That's a good suggestion. I'll look into improving the tests. I 
think I'll write the tests Java and spawn the JVM with correct classpath 
using Ant rather than using make and shell-scripts though, to make it 
more portable.

> Asking to look at another contrib like spi may be confusing... 
> especially in case of trouble.

The Server Programming Interface (SPI) is not another contrib. It's an 
integral part of the PostgreSQL core distribution and it's the function 
package on which the Pl/Java JDBC driver is built. I agree it's not 
ideal to refer to it but rather than copying and maintaining a vast 
amount of information from the PostgreSQL manual (I have somewhat 
limited resources ;-), I chosed to mention it in the user guide in order 
to explain:

a) why some limitations are there that is due to the use of SPI.
b) that the JDBC connection runs within the same transaction as the invoker.
c) that detailed info regarding the command execution can be found, 
reading about the SPI in the PostgreSQL manual.

> I suppose I would have to change it to:
>
> su - postgres -c 'sh -c "( export 
> CLASSPATH=/Library/Java/Extensions/pljava.jar ; 
> /usr/local/bin/postmaster -i -D /usr/local/pgsql/data >> 
> /usr/local/pgsql/logs/logfile 2>&1 & )"'
>
> What do you think ? More to put in the CLASSPATH ? the postgresql.jar ?

Your suggested classpath looks OK. The postgresql.jar should not be in 
the classpath since Pl/Java uses it's own JDBC driver that sits directly 
on top of the SPI functions.

Another prerequisite is that the LD_LIBRARY_PATH is set so that the 
postmaster can find the jvm shared lib (in the Java distribution).  
Judging from the error you get, your setting must be correct, the pljava 
shared lib wouldn't load at all if it was wrong.

Kind regards,

Thomas Hallgren





More information about the Pljava-dev mailing list