agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Configuring PLJava
Date: Mon, 27 Jun 2011 17:32:47 -0700
Message-ID: <4E09212F.60100@gmail.com> (raw)

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;



view thread (5+ messages)  latest in thread

Message-ID: <4E09212F.60100@gmail.com>
Permalink:  ../4E09212F.60100@gmail.com/
Also on:    postgresql.org/message-id/4E09212F.60100@gmail.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] Configuring PLJava
  In-Reply-To: <4E09212F.60100@gmail.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