[Pljava-dev] Fwd: Re: Calling it a day

From: johann at 2ndquadrant(dot)com (Johann 'Myrkraverk' Oskarsson)
To:
Subject: [Pljava-dev] Fwd: Re: Calling it a day
Date: 2011-05-04 16:38:36
Message-ID: op.vuytum2nuxs6vk@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

On Wed, 04 May 2011 15:14:04 -0000, JOSE CARLOS MARTINEZ LLARIO
<jcllario at hotmail.com> wrote:

>
> Hi Erik,
> I just checked it out right now getting the same results than I got some
> weeks before.
> W7 64 - Pg 9 32 - JRE 32 - PLJAVA 32 - Working
> W7 64 - Pg 9 32 - JRE 64 - PLJAVA 32 - not working, with this error:
> ERROR: could not load library "c:/jaspa4pg/lib/pljava.dll": %1 is not a
> valid Win32 application.
> Do not why with JRE 64 is not working but with JRE 32 I can tell you
> that its working for sure.

That is expected. It's simply not possible to mix 32bit and 64bit code in
applications [*]. However, the error message is misleading, the %1 is not
referring to pljava.dll but to some dependency of it. In this case
jvm.dll.

It is interesting to note that the error messages coming from the dynamic
linker (part of the operating system) are totally useless on Windows. It
is possible that Postgres is not filling the %1 in correctly, but I have a
feeling that's Windows' fault.

Compare this with the equivalent message on Solaris:

% java -cp $CLASSPATH org.postgresql.pljava.deploy.Deployer \
-host pgnode1 -port 58903 -database template1 \
-user postgres9 -install

org.postgresql.util.PSQLException: ERROR: could not load library
"/opt/myrkraverk/postgresql/9.0.3/lib/amd64/pljava.so": ld.so.1:
postgres: fatal: libjvm.so: open failed: No such file or directory

Here the server has only 32bit Java installed. Linux should have an ent-
irely equivalent message.

Also, when the dependency, jvm.dll, is not found, Windows says

psql:C:/jaspa4pg/sql/pljavainstall.sql:6: ERROR: could not load
library "c:/jaspa4pg/lib/pljava.dll": The specified module could
not be found.

What module? My previous error message on Solaris told me exactly what
it wasn't finding. The solution here is to add the JRE bin directories
to the system Path and then restart the server.

I'm re-iterating these problems and solutions for posterity. In the hope
that some future googler will find them useful.

Unix (all I've used) has entirely different search paths for 32bit and
64bit dynamic libraries so there is no naming conflict here, unlike Wind-
ows it seems.

[*] This is not always true, 64bit kernels (of various operating systems)
can run 32bit applications. They do however have the necessary hooks to
mix the execution contexts. Unlike normal applications.

--
Johann Oskarsson http://www.2ndquadrant.com/ |[]
PostgreSQL Development, 24x7 Support, Training and Services --+--
|
Blog: http://my.opera.com/myrkraverk/blog/

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Eric Kolotyluk 2011-05-04 16:40:55 [Pljava-dev] Windows 64bit officially released
Previous Message JOSE CARLOS MARTINEZ LLARIO 2011-05-04 16:20:47 [Pljava-dev] Windows 64bit: Call for further testing