agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Fwd: Re:  Calling it a day
Date: Wed, 04 May 2011 16:38:36 -0000
Message-ID: <op.vuytum2nuxs6vk@localhost> (raw)
In-Reply-To: <DUB101-w53C9C134D9AFC7D141F409D3810@phx.gbl>
References: <4DBB58FD.3090004@gmail.com>
	<DUB101-w33F119ADEB66AF3AF43063D39D0@phx.gbl>
	<4DC0E8AB.4000105@gmail.com>
	<DUB101-w53C9C134D9AFC7D141F409D3810@phx.gbl>

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/




view thread (16+ messages)  latest in thread

Message-ID: <op.vuytum2nuxs6vk@localhost>
Permalink:  ../op.vuytum2nuxs6vk@localhost/
Also on:    postgresql.org/message-id/op.vuytum2nuxs6vk@localhost

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] Fwd: Re:  Calling it a day
  In-Reply-To: <op.vuytum2nuxs6vk@localhost>

* 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