Hi -<div><br></div><div>I need to install pljava so that I can use Adempiere 3.42s, an open-source ERP (enterprise resource planning) suite which uses Java, Postgres, and pljava.</div><div><br></div><div>I've been trying for three days to install pljava with Postgres 8.3 and Java 1.5 on Windows XP, but it always returns an error message about not being able to load pljava.dll. </div>
<div><br></div><div>(I admit that I wasted a day trying to install pljava with Postgres 8.4 and Java 1.6, until I finally found a message here:</div><div><br></div><div><a href="http://old.nabble.com/pljava-install-problems-td28493671.html">http://old.nabble.com/pljava-install-problems-td28493671.html</a></div>
<div><br></div><div><a href="http://old.nabble.com/pljava-install-problems-td28493671.html"></a>saying that this isn't supported. More specifically, it says that there *is* a way to install pljava with Postgres 8.4 and run with Java 1.6, if you use use CVS to download the sources for pljava and build using Java 1.5. I installed Tortoise CVS and managed to checkout the sources to my WinXP machine, but then I got stuck because I couldn't figure out how to do the build. I noticed that the sources included a file called Makefile, and also included some C header files. This confused me. I've only done builds in Java on Windows using Ant or Maven - I have no idea how to do a build in Java on Windows involving a Makefile. I do have a Debian server elsewhere, so I thought about trying to do the build there - but it's already running Java 1.6 under Debian Lenny, and I'm afraid of messing that server up if I were to install Java 1.5 on it just for the purpose of trying to build pljava from source. Anyways, the errors I've been getting always involve a file called pljava.dll, and I'm not sure that doing a make under Debian would produce a dll file, as they are used for Windows.)</div>
<div><br></div><div>I'm on the verge of a nervous breakdown now from frustration and lack of sleep, since every time I attempt a new approach, I think I'm close to getting it to work this time... and then I end up staying up till 4 or 5 in the morning until finally collapsing from exhaustion. </div>
<div><br></div><div>I'm accustomed to encountering difficulties when installing new software. However, this situation seems worse that the normal, because Google turns up lots of people with this same problem, but no people offering a solution. </div>
<div><br></div><div>According to this Google search, pljava may be broken since Postgres 8.3:</div><div><br></div><div><a href="http://www.google.com/search?&safe=off&q=pljava+broken+8.3RC1">http://www.google.com/search?&safe=off&q=pljava+broken+8.3RC1</a></div>
<div><br></div><div>This is unfortunate, as pljava is an important procedural language for Postgres. In particular, pljava is required by Adempiere, which is one of the top open-source ERP (enterprise resource planning) packages.</div>
<div><br></div><div>Does anyone have a fix to enable installing pljava in Postgres 8.3 (or later) on Windows?</div><div><br></div><div>+++</div><div><br></div><div>As far as I understand, there are two methods for installing pljava. Neither one has worked. The complete error messages are shown below, essentially saying:</div>
<div><br></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">ERROR: could not load library "C:/Program Files/PostgreSQL/8.3/lib/pljava.dll": The specified module could not be found.</span><br>
</div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace; "><br></span></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace; "><span class="Apple-style-span" style="font-family: arial; "><div>
By the way, the file pljava.dll does exist in the above directory. I assume the error message means that some other module (which pljava.dll is dependent on) couldn't be found.</div><div><br></div><div><br></div></span></span></div>
<div>Method 1:</div><div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">C:\Program Files\PostgreSQL\8.3\share\pljava>java org.postgresql.pljava.deploy.Deployer -install -database adempiere -user postgres -password postgres</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">org.postgresql.util.PSQLException: ERROR: could not load library "C:/Program Files/PostgreSQL/8.3/lib/pljava.dll": The specified module could not be found.</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:194)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:328)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> at org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269)</font></div></div><div><br></div><div><br></div><div>Method 2:</div><div>
<br></div><div><div><font class="Apple-style-span" face="'courier new', monospace">C:\Program Files\PostgreSQL\8.3\share\pljava>psql -f install.sql adempiere postgres</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Password for user postgres:</font></div><div><font class="Apple-style-span" face="'courier new', monospace">CREATE SCHEMA</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">GRANT</font></div><div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:6: ERROR: could not load library "C:/Program Files/PostgreSQL/8.3/lib/pljava.dll": The specified module could not be found.</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:8: ERROR: function sqlj.java_call_handler() does not exist</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:12: ERROR: could not load library "C:/Program Files/PostgreSQL/8.3/lib/pljava.dll": The specified module could not be found</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:14: ERROR: function sqlj.javau_call_handler() does not exist</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:23: NOTICE: CREATE TABLE will create implicit sequence "jar_repository_jarid_seq" for serial column "jar_repository.jarid"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:23: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "jar_repository_pkey" for table "jar_repository"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:23: NOTICE: CREATE TABLE / UNIQUE will create implicit index "jar_repository_jarname_key" for table "jar_repository"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">CREATE TABLE</font></div><div><font class="Apple-style-span" face="'courier new', monospace">GRANT</font></div><div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:32: NOTICE: CREATE TABLE will create implicit sequence "jar_entry_entryid_seq" for serial column "jar_entry.entryid"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:32: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "jar_entry_pkey" for table "jar_entry"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:32: NOTICE: CREATE TABLE / UNIQUE will create implicit index "jar_entry_jarid_key" for table "jar_entry"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">CREATE TABLE</font></div><div><font class="Apple-style-span" face="'courier new', monospace">GRANT</font></div><div><font class="Apple-style-span" face="'courier new', monospace">ALTER TABLE</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:43: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "classpath_entry_pkey" for table "classpath_entry"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">CREATE TABLE</font></div><div><font class="Apple-style-span" face="'courier new', monospace">GRANT</font></div><div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:50: NOTICE: CREATE TABLE will create implicit sequence "typemap_entry_mapid_seq" for serial column "typemap_entry.mapid"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:50: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "typemap_entry_pkey" for table "typemap_entry"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">CREATE TABLE</font></div><div><font class="Apple-style-span" face="'courier new', monospace">GRANT</font></div><div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:55: ERROR: language "java" does not exist</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:59: ERROR: language "java" does not exist</font></div><div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:63: ERROR: language "java" does not exist</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:67: ERROR: language "java" does not exist</font></div><div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:71: ERROR: language "java" does not exist</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:75: ERROR: language "java" does not exist</font></div><div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:79: ERROR: language "java" does not exist</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:83: ERROR: language "java" does not exist</font></div><div><font class="Apple-style-span" face="'courier new', monospace">psql:install.sql:87: ERROR: language "java" does not exist</font></div>
</div><div><br></div><div><br></div><div>Method 3 - Following the instructions here:</div><div><br></div><div><a href="http://www.adempiere.com/index.php/Adempiere_Install_WinXp">http://www.adempiere.com/index.php/Adempiere_Install_WinXp</a></div>
<div><br></div><div><a href="http://www.adempiere.com/index.php/Adempiere_Install_WinXp"></a>I added the following lines to the file C:\Program Files\PostgreSQL\8.3\data\postgresql.conf:</div><div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace">custom_variable_classes = 'pljava'</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">pljava.classpath = 'C:\\Program Files\\PostgreSQL\\8.3\\share\\pljava\\pljava.jar' </font></div><div><font class="Apple-style-span" face="'courier new', monospace">pljava.release_lingering_savepoints = true</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">pljava.vmoptions = '-Xmx64M -Dbackchannel.port=48'</font></div><div><font class="Apple-style-span" face="'courier new', monospace">pljava.debug = false</font></div>
</div><div><br></div><div>and and stopped and started the Postgres server before attempting the above two methods, but they still returned the same error messages.</div><div><br></div><div>+++</div><div><br></div><div>Here are the attempts I've made to try to diagnose and fix this problem. None of these attempts has worked.</div>
<div><br></div><div>Attempt 1 - I checked my JRE_HOME environment variable in WinXP. I made sure that it was a system variable (not a user variable), and that it's included in the PATH environment variable. I also rebooted the computer.</div>
<div><br></div><div>If I do:</div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">dir %JRE_HOME%\bin\client</font></div><div><br></div><div>the output looks ok:</div><div><br></div>
<div><div><font class="Apple-style-span" face="'courier new', monospace"> Directory of C:\programs\Java\jdk1.5.0_22\jre\bin\client</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">06/08/2010 02:43 PM <DIR> .</font></div><div><font class="Apple-style-span" face="'courier new', monospace">06/08/2010 02:43 PM <DIR> ..</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">06/08/2010 02:43 PM 12,713,984 classes.jsa</font></div><div><font class="Apple-style-span" face="'courier new', monospace">10/09/2009 03:16 AM 1,626,233 jvm.dll</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">06/08/2010 02:37 PM 1,447 Xusage.txt</font></div></div><div><br></div><div><br></div><div>If I do:</div><div><br></div><div>PATH</div>
<div><br></div><div>the output (with some returns added for readability) also looks ok:</div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">PATH=</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C:\windows\system32;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C:\Programs\MaudeFW\2.4\cygwin\bin;</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C:\Program Files\PC Connectivity Solution;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C:\Program Files\TortoiseSVN\bin;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C:\Sun\SDK\lib\ant\bin;</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C:\programs\maven\apache-maven-2.2.1\bin;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C:\Programs\PostgreSQL\8.4\bin;</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C:\programs\Java\jdk1.5.0_22\bin;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C:\programs\Java\jdk1.5.0_22\jre\bin;</font></div><div><font class="Apple-style-span" face="'courier new', monospace">C:\programs\Java\jdk1.5.0_22\jre\bin\client;</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">C:\Program Files\CVSNT\;C:\Program Files\PostgreSQL\8.3\bin</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><div style="font-family: arial; ">
<br></div><div style="font-family: arial; "><div>So the file jvm.dll should be available. </div><div><br></div><div>By the way, I have un-installed Postgres 8.3, deleted the WinXP user postgres, re-booted the computer, re-installed Postgres 8.3 (with the above environment variables in effect), hoping that this might make the Postgres 8.3 installer add pljava during the install, but no luck. During the Postgres 8.3 install, there is a tree of components to be installed which initially shows "PL/Java" with a red "X" on it, so of course I changed this to "Install to hard disk". Later during the install, there is a list of procedural languages which can be installed, and only the first one is checked - the remaining ones (including "PL/Java") are all dimmed, and unchecked, and cannot be checked.</div>
<div><br></div></div></font></div><div><br></div><div>Attempt 2 - I used a program called Dependency Walker to check whether pljava.dll has any unsatisfied dependencies. This program gave one error and one warning:</div><div>
<br></div><div>- The error said that there was a dll which pljava.dll depended on, called c:\windows\system32\libeay32.dll, which had "an unresolved import due to a missing export function in an implicitly dependent module."</div>
<div><br></div><div>- The warning said that there was a dll which pljava.dll depdended on, called c:\windows\system32\mpr.dll, which had an "unresolved import due to a missing export function in a delay-load dependent module."</div>
<div><br></div><div>I tried two ways of fixing the error: First, I tried to install OpenSSH for Windows, which includes the dll libeay32.dll, and I copied this dll into C:\windows\system32. That didn't resolve the error message. Then I noticed that directory c:\Program Files\PostgreSQL\8.3\bin also contains a file called libeay32.dll, so I copied that into c:\windows\system32, and that resolved the error message.</div>
<div><br></div><div>I couldn't figure out a way to resolve the warning about the other dll, mpr.dll - but since it's only a warning (not an error), maybe it's not fatal.</div><div><br></div><div><br></div><div>
Attempt 3 - I also tried installing using various EnterpriseDB installers, to see if they gave different results. But the same error messages continued to occur.</div><div><br></div><div>+++</div><div><br></div><div>I'm totally stuck and I don't know what to do now. I'd really like to be able to use pljava with Postgres. </div>
<div><br></div><div>Thanks for any help.</div><div><br></div><div>- Scott Alexander</div><div><br></div>