pg.ddx.io  pljava-dev@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Failed to create Java VM, WinXP
Date: Fri, 24 Jun 2011 17:10:01 -0400
Message-ID: <A7851B7C99EE6A46BC0AFD5C45FC9D760AD386@MX13A.corp.emc.com> (raw)
In-Reply-To: <F3CBFBA88397EA498B22A05FFA9EC49D295E9189@MX22A.corp.emc.com>
References: <F3CBFBA88397EA498B22A05FFA9EC49D295E9189@MX22A.corp.emc.com>

I faced a similar issue with PostgreSQL 8.1 - on WindowsXP...

The root cause of this is that : pljava.dll has a dependency on libpq.dll - which is going to be present in $INSTALLATION_PATH/lib... 
I was able to get around this problem by updating the System PATH variable ("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment") - this is the path variable setting when sets up the PATH variable system wide by : My Computer -> Advanced -> Environment Variables - to include $INSTALLATION_PATH/lib

This is required because Postgres runs as service on windows... On *nix systems, I achieved the same by using ldconfig and crle on Solaris, such that pljava.dll/pljava.so can dynamically load libpq.dll/libpg.so. Of course, on *nix system LD_LIBRARY_PATH would also work - but that would have to be setup in a script that starts Postgres. Using ldconfig of course makes libpq.so visible for dynamic loading system wide.

Hope this helps.
-Janardhan

-----Original Message-----
From: pljava-dev-bounces at pgfoundry.org [mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of david.sahagian at emc.com
Sent: Friday, June 24, 2011 2:50 PM
To: pljava-dev at pgfoundry.org
Subject: [Pljava-dev] Failed to create Java VM, WinXP

I am trying to get pljava set up on my Windows XP machine.

()
I am running
"PostgreSQL 9.0beta4, compiled by Visual C++ build 1500, 32-bit"

()
I downloaded: pljava-i686-pc-mingw32-pg9.0-1.4.2.tar.gz

()
I made these changes to postgresql.conf . . .

  custom_variable_classes = 'pljava'
  pljava.classpath = 'C:\\Program Files\\PostgreSQL\\9.0\\lib\\pljava.jar'

()
I replaced the files "pljava.dll" and "pljava.jar",
which were in C:\Program Files\PostgreSQL\9.0\lib,
with the files in the pljava download.

()
I added the following entries to the PATH var:

set PATH=%PATH%;C:\Program Files\Java\jre6\bin;C:\Program Files\Java\jre6\bin\client

()
I restarted my laptop.

()
I applied "install.sql" to the db, using psql.
and saw:
CREATE SCHEMA
GRANT
CREATE FUNCTION
CREATE LANGUAGE
. . .
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION

()
I did

CREATE or Replace FUNCTION getsysprop(VARCHAR)
  RETURNS VARCHAR
  AS 'java.lang.System.getProperty'
  LANGUAGE java;

This worked, it created the function in the "public" schema.

()
But when I ran this:
  SELECT getsysprop('user.home');
I got:
  ERROR:  Failed to create Java VM


Can somebody help me troubleshoot my failed attempt at installing ?
Thanks.


_______________________________________________
Pljava-dev mailing list
Pljava-dev at pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pljava-dev





view thread (4+ messages)  latest in thread

Message-ID: <A7851B7C99EE6A46BC0AFD5C45FC9D760AD386@MX13A.corp.emc.com>
Permalink:  ../A7851B7C99EE6A46BC0AFD5C45FC9D760AD386@MX13A.corp.emc.com/
Also on:    postgresql.org/message-id/A7851B7C99EE6A46BC0AFD5C45FC9D760AD386@MX13A.corp.emc.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] Failed to create Java VM, WinXP
  In-Reply-To: <A7851B7C99EE6A46BC0AFD5C45FC9D760AD386@MX13A.corp.emc.com>

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

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