|
From: <php...@li...> - 2009-04-29 07:48:31
|
Hello, do you mean that fat jar is not the best solution? How to use jar://URI? (maybe a simple example or a link where I can find some examples) Where exactly do I find the proposal? Hi, Although it is possible to fetch libraries from other jar files using a jar:// URI, at least in the Sun Java platform, this feature may not work on other platforms; GCC/GCJ uses ELF libs instead. I think there's no use for this feature. If you're looking for a java module system, read the proposal from the RICE people, which was inspired by the SML/NJ. It uses real generics to build compound modules. Regards, Jost Boekemeier Apr 28, 2009 3:24 nachm. schrieb am < php...@li...>: Hello Jost, I am very sorry but I still can't solve the problem which I described yesterday. I try to explain it again in other words, maybe I explained it not very clearly. Well there are many jars in one jar (fat jar) I don't have to change anything in this structure, I need only to access the classes . I tryed to get it with java_require and got this error: exception javax.servlet.ServletException: java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:JavaBridge]]->updateJarLibraryPath((o:String)[o:String], (o:String)[o:String], (o:String)[o:String], (o:String)[o:String]). Cause: java.io.IOException: Could not open jar file WebProjekt2, reason: WebProjekt2 (Das System kann die angegebene Datei nicht finden) VM: 1.6.0_10@http://java.sun.com/" at: #-18 php.java.bridge.DynamicJavaBridgeClassLoader.checkJarFile(DynamicJavaBridgeClassLoader.java:108) #-17 php.java.bridge.JarLibraryPath.createUrls(JarLibraryPath.java:192) #-16 php.java.bridge.JarLibraryPath.checkURLs(JarLibraryPath.java:117) #-15 php.java.bridge.JarLibraryPath.<init>(JarLibraryPath.java:64) #-14 php.java.bridge.DynamicJavaBridgeClassLoader.checkJarLibraryPath(DynamicJavaBridgeClassLoader.java:74) #-13 php.java.bridge.DynamicJavaBridgeClassLoader.updateJarLibraryPath(DynamicJavaBridgeClassLoader.java:87) #-12 php.java.bridge.SimpleJavaBridgeClassLoader.updateJarLibraryPath(SimpleJavaBridgeClassLoader.java:111) #-11 php.java.bridge.J in http://localhost:8081/Ordner/java/Java.inc on line 215 php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:416) php.java.servlet.CGIServlet.doGet(CGIServlet.java:469) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) root cause java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:JavaBridge]]->updateJarLibraryPath((o:String)[o:String], (o:String)[o:String], (o:String)[o:String], (o:String)[o:String]). Cause: java.io.IOException: Could not open jar file WebProjekt2, reason: WebProjekt2 (Das System kann die angegebene Datei nicht finden) VM: 1.6.0_10@http://java.sun.com/" at: #-18 php.java.bridge.DynamicJavaBridgeClassLoader.checkJarFile(DynamicJavaBridgeClassLoader.java:108) #-17 php.java.bridge.JarLibraryPath.createUrls(JarLibraryPath.java:192) #-16 php.java.bridge.JarLibraryPath.checkURLs(JarLibraryPath.java:117) #-15 php.java.bridge.JarLibraryPath.<init>(JarLibraryPath.java:64) #-14 php.java.bridge.DynamicJavaBridgeClassLoader.checkJarLibraryPath(DynamicJavaBridgeClassLoader.java:74) #-13 php.java.bridge.DynamicJavaBridgeClassLoader.updateJarLibraryPath(DynamicJavaBridgeClassLoader.java:87) #-12 php.java.bridge.SimpleJavaBridgeClassLoader.updateJarLibraryPath(SimpleJavaBridgeClassLoader.java:111) #-11 php.java.bridge.J in http://localhost:8081/Ordner/java/Java.inc on line 215 The video which you recommended is only about one "folder"with classes. In my case it is not so. As Ihave already written "jars in jar"(fat jar) and I must not change this structure... It does not work: <?php require_once("http://localhost:8081/Ordner/java/Java.inc"); $System = java("java.lang.System"); $myObj = new java("web.FacettenBrowser"); echo $myObj->HalloWelt(); ?> Many thanks in advance! ------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users ------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2009-04-30 07:36:05
|
I think this feature isn't useful for applications. The tomcat container
uses it to open the .war files:
<?php require_once("
http://localhost:8081/JavaBridgeTemplate5442/java/Java.inc");
echo
java("java.lang.Thread")->currentThread()->getContextClassLoader()->getResource("php/java/bridge/global.properties");
echo "\n";
?>
=>
jar:file:/home/opt/apache-tomcat-6.0.18/webapps/JavaBridgeTemplate5442/WEB-INF/lib/JavaBridge.jar!/php/java/bridge/global.properties
If you write your own class loader derived from url class loader, you may do
the same from PHP -- java_require uses an url loader, but it also needs a
timestamp.
There are several papers from rice.edu on this topic (java "link-time
components"), for example this one: http%3A%2F%2Fwww.cs.rice.edu
%2F~javaplt%2Fpapers%2Fsac2007.pdf
Regards,
Jost Boekemeier
Apr 29, 2009 9:48 vorm. schrieb am <
php...@li...>:
Hello,
do you mean that fat jar is not the best solution? How to use jar://URI?
(maybe a simple example or a link where I can find some examples) Where
exactly do I find the proposal?
Hi, Although it is possible to fetch libraries from other jar files using a
jar:// URI, at least ...
|