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@pgadmin.org]
Sent: 28 January 2008 09:43
To: David JL Gradwell
Cc: Kris Jurka; pgsql-bugs@postgresql.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@gradwell.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.