From: Michael P. D. <dob...@we...> - 2005-03-21 16:57:27
|
Dear Experts! Yesterday I installed the Java-Bridge (ver. 2.0.4) and everything works fine so far, but I'm struggling with JAR, CLASSPATH or whatever the problem generates. With PHP I call a Java-Class (UserClass1) stored in a JAR-file (jarfile.jar). In PHP I "link" to this JAR file with: java_set_library_path("/srv/www/htdocs/user/jarfile.jar"). In that JAR-File there is also a file (Data.File) stored, which is called by another JAVA-Class (UserClass2) with java.net.JarURLConnection and ClassLoader-Function. UserClass2 is called by UserClass1. This works fine by calling it direct with java (java -classpath jarfile.jar UserClass1) but by using it with the Java-Bridge it does not work. Here the UserClass2 can't find the Data.File. To get an idea, what's going wrong, I inserted a further class (ShowResources.class) (http://forum.java.sun.com/thread.jspa?threadID=286026&messageID=3034420) which shows me ALL accessible resources (output in the /var/log/php-java-bridge.log). ShowResources is called in UserClass2 before trying to load Data.File. With this information I saw, that only the classes of JavaBridge.jar and the java-classes are accessible by the ClassLoader, but my jarfile.jar is not. So I tried to reference it in the php.ini with the setup-variable java.classpath (I also tried java.class.path) but without any access. I also saved the jarfile.jar under /usr/lib/php/extensions. Nothing is working; everytime only the above mentioned classes are available. So I'm at my wits end and I hope you can help me to solve this problem. Many thanks in advance Michael |