[Pljava-dev] Configuring PLJava

From: eric(dot)kolotyluk at gmail(dot)com (Eric Kolotyluk)
To:
Subject: [Pljava-dev] Configuring PLJava
Date: 2011-06-28 00:32:47
Message-ID: 4E09212F.60100@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

OK, I finally managed to get PLJava working on Windows XP with
PostgreSQL 9.0.

Some weeks back I tried for 2 days to get it working, but kept running
into DLL Hell issues. In retrospect, I probably missed some crucial
configuration step, and diagnosing the problem became hell.

So on Windows XP SP3 I

* installed jdk-6u20-windows-i586.exe
o There are known problems with updates > 20, but I am not
sure if they affect PLJava, I'm just playing it safe
* set the environment variables
o JRE_HOME = C:\Program Files\Java\jre6
o PGHOME = C:\Program Files\PostgreSQL\9.0
o PGDATA = C:\Program Files\PostgreSQL\9.0\data
o Path += ;C:\Program Files\Java\jre6\bin
o Path += ;C:\Program Files\Java\jre6\client
+ on a 64-bit Java this would be "server" instead of
"client"
o Path += ;C:\Program Files\PostgreSQL\9.0\bin
o Path += ;C:\Program Files\PostgreSQL\9.0\lib
o it is best to have all your environment variables set
correctly before running postgresql
* installed postgresql-9.0.4-1-windows_x32.exe as built by
Enterprise DB using default settings
o note: the installer does not work properly on XP if you
change some of the settings, such as PGHOME or PGDATA. I've
reported this as a bug, but I doubt it will ever be fixed
+ I do not have this problem on Windows 7
o This release actually has a working PLJava in it, so there
is nothing more to install
+ With the 64-bit version I have to repair the
PostgreSQL installation with a bunch of 64-bit files
# msvcm90.dll
# msvcp90.dll
# msvcr90.dll
# IEShims.dll
# and I have to add the PLJava files from the
latest release
* edited the PGDATA\postgresql.conf file and added
o custom_variable_classes = 'pljava'
o pljava.classpath = '$libdir/pljava.jar'
* Restarted the server with "net restart postgresql-9.0"
o It is crucial all your environment variable are set properly
before starting or restarting the server
o using "pg_ctl reload" causes the server to crash
+ I do not have this problem on Windows 7
o using the program menu doesn't work either, same problem
o using "pg_ctl restart" you always get: FATAL: could not
create lock file "postmaster.pid": Permission denied
* using cmdtool
o cd ...\share\pljava
o psql -f install.sql postgres postgres

Which seems to work so far - that's always the hardest part. I have yet
to test it with my actual Java code on anything except 32-bit PostgreSQL
on 32-bit Windows 7.

Basically configuring PLJava and getting it to work is an extremely
fragile process. Get something wrong and you're headed for days of misery...

I have written software which automates this whole process for Windows
XP, Vista, 7, etc. as well as 32-bit and 64bit variants, because it is
totally insane to try to do it manually.

Cheers, Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20110627/103d3c6e/attachment.html>

Responses

Browse pljava-dev by date

  From Date Subject
Next Message sumo 2011-07-01 23:39:59 [Pljava-dev] Internal datatype
Previous Message Johann 'Myrkraverk' Oskarsson 2011-06-24 22:36:06 [Pljava-dev] Failed to create Java VM, WinXP