|
From: <php...@li...> - 2007-06-20 14:43:40
|
Well, even in other examples where I have everything spelled correctly, I still get this problem. It seems that I have to completely restart Apache before it'll find any new Java methods but even then, it doesn't find certain methods in my Java classes. Is this always true though, where I have to restart Apache to allow the php-java-bridge to find any newly added Java methods? Is this the same for running the Java side in it's own VM via tomcat? Thanks, Jim On Jun 20, 2007, at 7:09 AM, php-java-bridge-users- re...@li... wrote: > Send php-java-bridge-users mailing list submissions to > php...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > or, via email, send a message with subject or body 'help' to > php...@li... > > You can reach the person managing the list at > php...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of php-java-bridge-users digest..." > > > Today's Topics: > > 1. Re: Windows Extension > (php...@li...) > 2. Re: jboss/tomcat, JavaBridge.war, log4j configuration reset > (php...@li...) > 3. Re: MySQL Connection (php-java-bridge- > us...@li...) > 4. Re: Protocol Invalid Document End error > (php...@li...) > 5. php-java-bridge and tomcat cluster > (php...@li...) > 6. Re: php-java-bridge and tomcat cluster > (php...@li...) > 7. Troubles calling a simple Java app > (php...@li...) > 8. Re: Troubles calling a simple Java app > (php...@li...) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 18 Jun 2007 14:07:44 +0200 (CEST) > From: php...@li... > Subject: Re: [Php-java-bridge-users] Windows Extension > To: php...@li..., > php...@li... > Message-ID: <880...@we...> > Content-Type: text/plain; charset=iso-8859-1 > > Hi Benjamin, > >> I used an older version of the bridge with >> php_java.dll under windows. > > The php_java.dll and java.so is available in the > legacy download. Since PHP version 5.1.4 these are not > needed anymore. > > >> I have to recompile the bridge extension > > You may compile a php_java.dll on windows (if you know > how to do this and if you have the right tools). But > you don't need to. > > >> , but I don't how how. > > Use the pure PHP implementation, then. > > > Regards, > Jost Boekemeier > > > __________________________________________________ > Do You Yahoo!? > Sie sind Spam leid? Yahoo! Mail verf?gt ?ber einen herausragenden > Schutz gegen Massenmails. > http://mail.yahoo.com > > > > ------------------------------ > > Message: 2 > Date: Mon, 18 Jun 2007 14:09:25 +0200 (CEST) > From: php...@li... > Subject: Re: [Php-java-bridge-users] jboss/tomcat, JavaBridge.war, > log4j configuration reset > To: php...@li... > Message-ID: <141...@we...> > Content-Type: text/plain; charset=iso-8859-1 > > Hi, > > I agree that this behaviour is annoying. We will > change this in version 4.1.3. > > > Regards, > Jost Boekemeier > > > > > ___________________________________________________________ > Telefonate ohne weitere Kosten vom PC zum PC: http:// > messenger.yahoo.de > > > > ------------------------------ > > Message: 3 > Date: Mon, 18 Jun 2007 14:13:43 +0200 (CEST) > From: php...@li... > Subject: Re: [Php-java-bridge-users] MySQL Connection > To: php...@li... > Message-ID: <473...@we...> > Content-Type: text/plain; charset=iso-8859-1 > > Hi, > >> Except that that the php-info example and the >> existing PHP web application which heavily depend on >> using MySQL are signaling that the MySQL extention >> is not included in the compilation and therefore no >> MySQL statements are processed. > > This has been fixed in version 4.1.2. Please use this > version instead. > > The bridge contains a php.exe and a php.ini file in > the WEB-INF/cgi directory. In previous versions the > system php executable used to read the local php.ini, > even though the option prefer_system_php_exec is set > to On in the web-inf/web.xml. > > As a immediate workaround please delete the php.ini > from the WEB-INF/web.xml directory. > > > Regards, > Jost Boekemeier > > > > > ___________________________________________________________ > Telefonate ohne weitere Kosten vom PC zum PC: http:// > messenger.yahoo.de > > > > ------------------------------ > > Message: 4 > Date: Mon, 18 Jun 2007 10:14:07 -0600 > From: php...@li... > Subject: Re: [Php-java-bridge-users] Protocol Invalid Document End > error > To: <php...@li...> > Message-ID: <BAY...@ph...> > Content-Type: text/plain; charset="iso-8859-1" > > I was using 4.1.0aI have updated to 4.1.2, and it appears to have > fixed the problemThanks for your help> Date: Sat, 16 Jun 2007 > 10:41:54 +0200> To: php...@li...> > From: php...@li...> Subject: Re: > [Php-java-bridge-users] Protocol Invalid Document End error> > Hi,> > > > java_require() not allowed for the HTTP Tunnel. Use> > a > context runner instead.> > which version of the PHP/Java Bridge do > you use?> The latest stable version is version 3.2.1.> > > > Regards,> Jost Boekemeier> > > > __________________________________________________> Do You Yahoo!?> > Sie sind Spam leid? Yahoo! Mail verf?gt ?ber einen herausragenden > Schutz gegen Massenmails. > http://mail.yahoo.com > > > ---------------------------------------------------------------------- > ---> This SF.net email is sponsored by DB2 Express> Download DB2 > Express C - the FREE version of DB2 express and take> control of > your XML. No limits. Just data. Click to get it now.> http > ://sourceforge.net/powerbar/db2/> > _______________________________________________> php-java-bridge- > users mailing list> php...@li...> > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > _________________________________________________________________ > Explore the seven wonders of the world > http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en- > US&form=QBRE > > ------------------------------ > > Message: 5 > Date: Mon, 18 Jun 2007 16:56:27 -0400 > From: php...@li... > Subject: [Php-java-bridge-users] php-java-bridge and tomcat cluster > To: <php...@li...> > Message-ID: > <072...@sw...> > Content-Type: text/plain; charset="iso-8859-1" > > Hi, > > There is something you could possibly help us with. We have a > cluster with two machines that have (tomcat 5.5.17), jdk1.5.0_06 > and php 5.1.2 each. Our web application uses php-java-bridge. We > have noticed a weird behavior though. When both instances of tomcat > are running within 15 to 30 min one of the tomcat instances stops > responding and a browser window where we are accessing our php > application blacks out. Has anyone experience a similar problem? We > have not found exception in the log files, so we have no clue what > could be going on. Please let me know if you need me to provide > more information to help me find out what could be causing the > failure in the tomcat cluster. > > Thank you very much in advance. > > > ------------------------------ > > Message: 6 > Date: Tue, 19 Jun 2007 10:52:07 +0200 (CEST) > From: php...@li... > Subject: Re: [Php-java-bridge-users] php-java-bridge and tomcat > cluster > To: php...@li... > Message-ID: <984...@we...> > Content-Type: text/plain; charset=iso-8859-1 > > Hi, > > I assume your setup is like this: > > http://www.onjava.com/pub/a/onjava/2004/03/31/clustering.html > > If I understand this correctly, the management node > must detect the failure of one of the cluster nodes > and switch it off. > > I haven't tested the bridge in a cluster environment > (we should do this, though); the bridge is a standard > web application so that the operation mode of the J2EE > environment should be completely transparent. > > Which cluster algorithm do you use? Do you use > sessions? How do you store the sessions? > > > Regards, > Jost Boekemeier > > > __________________________________________________ > Do You Yahoo!? > Sie sind Spam leid? Yahoo! Mail verf?gt ?ber einen herausragenden > Schutz gegen Massenmails. > http://mail.yahoo.com > > > > ------------------------------ > > Message: 7 > Date: Tue, 19 Jun 2007 13:14:19 -0400 > From: php...@li... > Subject: [Php-java-bridge-users] Troubles calling a simple Java app > To: php...@li... > Message-ID: <E1F...@e-...> > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I am new to the php-java-bridge and am experimenting with it. There > is probably something obvious that I am not seeing, but I cannot get > a simple example Java to PHP application bridge working. I used the > latest Debian packages which are using version 4.0.8a of the php-java- > bridge. I can see via phpinfo() that php-java-bridge is installed and > running via Apache2.2 right now. The following application works fine > (I got it from the examples page): > > Java: > > public class HelloWorld { > private String hw = "Hello World"; > > public String getHelloWorld() { > return hw; > } > } > > PHP: > > <?php > > java_require('http://192.168.1.128/java/HelloWorld.jar'); > $myObj = new Java('HelloWorld'); > > // display Hello World > echo (String) $myObj->getHelloWorld(); > > ?> > > > However, if I change the Java and PHP to the following, then I get > the following exception output: > > Hello World > Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke > failed: [[o:HelloWorld]]->setHellowWorld([o:PhpParserString]). Cause: > java.lang.NoSuchMethodException: setHellowWorld([o:PhpParserString]). > Candidates: [] Responsible VM: 1.5.0_11@http://java.sun.com/" at: #-5 > php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1106) #-4 > php.java.bridge.Request.handleRequest(Request.java:342) #-3 > php.java.bridge.Request.handleRequests(Request.java:388) #0 [internal > function]: Java->__call('setHellowWorld', Array) #1 /home/jhodapp/ > projects/java_bridge/HelloWorld.php(9): Java->setHellowWorld('Hello > world, on...') #2 {main}] thrown in /home/jhodapp/projects/ > java_bridge/HelloWorld.php on line 9 > > > Changed Java (throws exception): > > public class HelloWorld { > private String hw = "Hello World"; > > public String getHelloWorld() { > return hw; > } > > public void setHelloWorld(String incoming) { > hw = incoming; > } > } > > Changed PHP (throws exception): > > <?php > > java_require('http://192.168.1.128/java/HelloWorld.jar'); > $myObj = new Java('HelloWorld'); > > // display Hello World > echo (String) $myObj->getHelloWorld(); > > $myObj->setHellowWorld((String) "Hello world, once again."); > > ?> > > > Once I add my own method in the Java source, it no longer seems to > work. I'm compiling this via "javac HelloWorld.java" and making a jar > via: "jar cvf HelloWorld.jar HelloWorld.class" > > Is there something wrong with my setup? The site seems to be good at > helping you get setup with php-java-bridge for your OS environment, > but lacks good documentation from that point. > > Thanks, > > Jim Hodapp > > > ------------------------------ > > Message: 8 > Date: Wed, 20 Jun 2007 07:07:20 -0400 > From: php...@li... > Subject: Re: [Php-java-bridge-users] Troubles calling a simple Java > app > To: php...@li... > Message-ID: > <215...@CH...> > Content-Type: text/plain; charset="iso-8859-1" > > Umm, you just spelled your method name wrong: > > public void setHelloWorld(String incoming) { > hw = incoming; > } > > Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke > failed: [[o:HelloWorld]]->setHellowWorld([o:PhpParserString]). Cause: > java.lang.NoSuchMethodException: setHellowWorld([o:PhpParserString]). > Candidates: [] Responsible VM: 1.5.0_11@http://java.sun.com/ > <http://java.sun.com/> " at: #-5 > > There's an extra "w" in there. > > ________________________________ > > From: php...@li... on behalf > of php...@li... > Sent: Tue 6/19/2007 1:14 PM > To: php...@li... > Subject: [Php-java-bridge-users] Troubles calling a simple Java app > > > > I am new to the php-java-bridge and am experimenting with it. There > is probably something obvious that I am not seeing, but I cannot get > a simple example Java to PHP application bridge working. I used the > latest Debian packages which are using version 4.0.8a of the php-java- > bridge. I can see via phpinfo() that php-java-bridge is installed and > running via Apache2.2 right now. The following application works fine > (I got it from the examples page): > > Java: > > public class HelloWorld { > private String hw = "Hello World"; > > public String getHelloWorld() { > return hw; > } > } > > PHP: > > <?php > > java_require('http://192.168.1.128/java/HelloWorld.jar'); > $myObj = new Java('HelloWorld'); > > // display Hello World > echo (String) $myObj->getHelloWorld(); > > ?> > > > However, if I change the Java and PHP to the following, then I get > the following exception output: > > Hello World > Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke > failed: [[o:HelloWorld]]->setHellowWorld([o:PhpParserString]). Cause: > java.lang.NoSuchMethodException: setHellowWorld([o:PhpParserString]). > Candidates: [] Responsible VM: 1.5.0_11@http://java.sun.com/" at: #-5 > php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1106) #-4 > php.java.bridge.Request.handleRequest(Request.java:342) #-3 > php.java.bridge.Request.handleRequests(Request.java:388) #0 [internal > function]: Java->__call('setHellowWorld', Array) #1 /home/jhodapp/ > projects/java_bridge/HelloWorld.php(9): Java->setHellowWorld('Hello > world, on...') #2 {main}] thrown in /home/jhodapp/projects/ > java_bridge/HelloWorld.php on line 9 > > > Changed Java (throws exception): > > public class HelloWorld { > private String hw = "Hello World"; > > public String getHelloWorld() { > return hw; > } > > public void setHelloWorld(String incoming) { > hw = incoming; > } > } > > Changed PHP (throws exception): > > <?php > > java_require('http://192.168.1.128/java/HelloWorld.jar'); > $myObj = new Java('HelloWorld'); > > // display Hello World > echo (String) $myObj->getHelloWorld(); > > $myObj->setHellowWorld((String) "Hello world, once again."); > > ?> > > > Once I add my own method in the Java source, it no longer seems to > work. I'm compiling this via "javac HelloWorld.java" and making a jar > via: "jar cvf HelloWorld.jar HelloWorld.class" > > Is there something wrong with my setup? The site seems to be good at > helping you get setup with php-java-bridge for your OS environment, > but lacks good documentation from that point. > > Thanks, > > Jim Hodapp > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > > > > ------------------------------ > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > > ------------------------------ > > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > > End of php-java-bridge-users Digest, Vol 13, Issue 5 > **************************************************** |
|
From: <php...@li...> - 2007-06-21 11:08:27
|
Hi,
the following code may show the problem. It is written in PHP, but it could have been written in Java as well, as it demonstrates a problem with Java's URLClassLoader:
xtest.java:
public class xtest { public static String f() { return "12"; } }
xtest.php:
<?php
// The following code shows a bug in Java's URLClassLoader
// While running this script, modify xtest.jar, so that f() returns
// "123" instead of "12".
// You will see that the jar file is fetched (its size changes)
// but the URLClassLoader discards it and uses the cached
// jar file from the previous request.
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
while(true) {
$url = new java("java.net.URL", "http://localhost/xtest.jar");
$conn = $url->openConnection();
echo $conn->getContentLength(); echo "->";
$conn->disconnect();
$loader = java("java.net.URLClassLoader")->newInstance(array($url));
$clazz = $loader->loadClass("xtest");
echo $clazz->f(); echo "<br>\n";
sleep(1);
}
?>
---------------------------------
Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out.
|
|
From: <php...@li...> - 2007-06-21 13:39:01
|
Hi Jim, > have to > completely restart Apache before it'll find any new PHP doesn't keep any state, so you don't need to restart apache. The cache, if any, is in the back end. > methods? Is this the > same for running the Java side in it's own VM via > tomcat? Well, it is a URLClassLoader problem, which caches the loaded classes using an associated cache in the sun JVM. It'd be interesting if the GNU VM has the same problem. There are certainly ways to workaround this, but how much sense does it make to pull java libraries from a http:// URL during development, anyway? Due to the caching in the URLClassLoader's associated VM cache you'll need to restart the VM to see the new code. Why don't you simply use load local jar files instead? Regards, Jost Boekemeier ___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de |
|
From: <php...@li...> - 2007-06-23 17:25:19
|
Hi, since version 4.1.4 the bridge doesn't use a JarURLConnection anymore. This means that the DynamicClassLoader can now track changes in remote jar files. The problem was that, in order to load classes from a remote jar file, java had to copy it into a local temp directory and use the copy for all further operations. The standard jar loader creates a temporary copy and deletes it when the VM terminates. This behaviour makes the DynamicClassLoader unusable for remote files. I have added a connection class which fetches the remote jar file and caches it until the associated URL is finalized. Please see http://php-java-bridge.cvs.sourceforge.net/php-java-bridge/php-java-bridge/server/php/java/bridge/DynamicJarURLConnection.java?view=markup&sortby=date for details. (I haven't tested it very much, but the algorithm should work). Furthermore the bridge now contains a full-featured HTTP server which gets started by double-clicking on JavaBridge.jar. It cannot handle JSP pages, but it can handle server-side scripts, including python, php, bean shell and jscript. The server uses the standard discovery mechanism to load the script implementation. This means that you can add further script implementations by adding them to java ext dirs. Regards, Jost Boekemeier __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com |