BUG #3897: plJava dll still doesn't load for 8.3RC2

From: "David JL Gradwell" <David(at)Gradwell(dot)com>
To: "'Dave Page'" <dpage(at)pgadmin(dot)org>
Cc: "'Kris Jurka'" <books(at)ejurka(dot)com>, <pgsql-bugs(at)postgresql(dot)org>
Subject: BUG #3897: plJava dll still doesn't load for 8.3RC2
Date: 2008-01-29 15:33:54
Message-ID: DA6EE6FA97F840FC9E5F62D51919CEE9@davidnew
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dave & Kris,

I've dug into some of the problems I've been having in a bit more logical
detail.

A useful tool is Dependency Walker http://www.dependencywalker.com/

Try running this against pljava.dll. You will get varying results,
depending on the PATH and whether you have PostgreSQL 8.2 or 8.3 on the
PATH. In any case you will see clearly which dlls have to be on the PATH
and whether they can be seen by the dll loader.

From this we can see that PostreSQL 8.2.6 uses a dll called MSVCR71.dll
whereas PostreSQL 8.3RC2 uses MSVCR80.dll which is not to be found in
C:\WINDOWS\System32 on all my machines ! This seems to stop the pljava.dll
loading.

A couple of links give a useful insight:

http://blogs.gotdotnet.com/mikehall/archive/2005/12/01/498999.aspx

http://www.instant-registry-fixes.org/why-do-i-keep-receiving-msvcr80dll-mis
sing-errors/

From this I deduce that the MSVCR80.dll needs to be distributed in the
PostreSQL distribution for Windows.

As part of my investigation I wrote a small Java program that a potential
plJava user can run if they hit problems. It will give them some clues as
to what to look for ! See attached.

Regards

David Gradwell

-----Original Message-----
From: Dave Page [mailto:dpage(at)pgadmin(dot)org]
Sent: 28 January 2008 09:43
To: David JL Gradwell
Cc: Kris Jurka; pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3897: plJava dll still doesn't load for 8.3RC2

On Jan 28, 2008 9:33 AM, David JL Gradwell <David(at)gradwell(dot)com> wrote:
> Hi Dave,
>
> Thanks for the help. I have now got pljava working fine on 8.3RC2 and
have
> re-run all my tests against RC2. On a database with a data structure of
> 100+ tables and about 15 views with extensive (20+ per view) unions the
> performance is far better than 8.1 and better than 8.2.6, even on a small
> test machine.

Good news :-)

> Coming back to pljava, I've still had problems with the error messages
> (which seem to be the wrong way round!)and am happy to see if I can
improve
> them for the benefit of others. Specifically:
>
> a) "ERROR: Failed to create Java VM (SQL State is 'XX000')" when
> calling sqlj.install_jar actually means that pljava.classpath in
> postgresql.conf is either not set or not set correctly and hence
pljava.jar
> can not be found. pljava.classpath could be defaulted to "C:\Program
> Files\PostgreSQL\8.2\share\pljava" in the installation.

I'll leave that one for Kris or one of the other Java guys. I've
written maybe a dozen lines of Java code in my entire life!

> b) 'ERROR: could not load library "C:/pljava/pljava.dll": The
specified
> module could not be found.' on
> CREATE FUNCTION sqlj.java_call_handler()
> RETURNS language_handler AS 'pljava'
> LANGUAGE C;
> Means (as you said) that the jvm.dll can not be loaded and that the DOS
PATH
> doesn't include "C:\Program Files\Java\jdk1.6.0_02\jre\bin\client" or
> similar.

Thats a generic messages raised by PostgreSQL when it fails to load a
library - unfortunately I don't think there's not much that can be
done to improve things there, at least without some horribly platform
specific hacks.

Regards, Dave.

Attachment Content-Type Size
PLJavaCheckEnv.java application/octet-stream 2.5 KB
PLJavaCheckEnvButtonActionListener.java application/octet-stream 4.2 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Fetter 2008-01-29 15:59:20 Re: BUG #3910: Incorrect behavior of UPDATE statement on tables with constraints UNIQUE/PRIMARY KEY
Previous Message Alvaro Herrera 2008-01-29 13:12:07 Re: BUG #3910: Incorrect behavior of UPDATE statement on tables with constraints UNIQUE/PRIMARY KEY