Lists: | pljava-dev |
---|
From: | david(dot)sahagian at emc(dot)com (david(dot)sahagian at emc(dot)com) |
---|---|
To: | |
Subject: | [Pljava-dev] Failed to create Java VM, WinXP |
Date: | 2011-06-24 19:49:59 |
Message-ID: | F3CBFBA88397EA498B22A05FFA9EC49D295E9189@MX22A.corp.emc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
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.
From: | janardhan(dot)prabhakara at emc(dot)com (janardhan(dot)prabhakara at emc(dot)com) |
---|---|
To: | |
Subject: | [Pljava-dev] Failed to create Java VM, WinXP |
Date: | 2011-06-24 21:10:01 |
Message-ID: | A7851B7C99EE6A46BC0AFD5C45FC9D760AD386@MX13A.corp.emc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
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
From: | johann at 2ndquadrant(dot)com (Johann 'Myrkraverk' Oskarsson) |
---|---|
To: | |
Subject: | [Pljava-dev] Failed to create Java VM, WinXP |
Date: | 2011-06-24 22:09:09 |
Message-ID: | x6r56ic262.fsf@2ndquadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
<david.sahagian at emc.com> writes:
> ()
> 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
Where do you apply these settings? The PATH with the Java
installation has to be visible to the Postgres process.
Going overly technical on you, the environment variables are cloned
between processes in Unix systems.
Process A sets X=V. It then spawns a new process B. This causes B to
inherit all settings from A, including X=V. Process B sets X=W. On
reading X, process A still has the value V. They are not shared.
Process C spawned from B will now have X=W. It inherits the new
settings from B.
I've been told they behave exactly like this on Windows as well so it
matters a lot where and how the PATH settings are applied so the
Postgres server process, started as a Windows Service will read the
new values.
If you have another scripting language installed, you may be able to
read the server process' environment. Or with a C module.
--
Johann Oskarsson http://www.2ndquadrant.com/ |[]
PostgreSQL Development, 24x7 Support, Training and Services --+--
|
Blog: http://my.opera.com/myrkraverk/blog/
From: | johann at 2ndquadrant(dot)com (Johann 'Myrkraverk' Oskarsson) |
---|---|
To: | |
Subject: | [Pljava-dev] Failed to create Java VM, WinXP |
Date: | 2011-06-24 22:36:06 |
Message-ID: | x6liwqc0x5.fsf@2ndquadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
"Johann 'Myrkraverk' Oskarsson" <johann at 2ndquadrant.com> writes:
> <david.sahagian at emc.com> writes:
>
>> ()
>> 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
>
> Where do you apply these settings? The PATH with the Java
> installation has to be visible to the Postgres process.
On second thought, that's prorably not it. (Without looking at the
source) this is most likely because the Create_JavaVM() call is
failing and I think it means it's already been linked to JAVA.JLL.
I hope that points you somewhere. I may not have time until next
Friday to take a close look myself.
--
Johann Oskarsson http://www.2ndquadrant.com/ |[]
PostgreSQL Development, 24x7 Support, Training and Services --+--
|
Blog: http://my.opera.com/myrkraverk/blog/