|
From: <php...@li...> - 2010-05-31 15:00:48
|
Hi, >> you are calling procedures from the servlet package outside of a servlet >> environment. I am surprised that this works at all. > > I only attempted this so I could isolate the development of the Java to PHP > side from my servlet. Please use a servlet environment and use the methods from the EngineFactory to access the ScriptEngine. The JavaBridge.war example contains two examples: The http://php-java-bridge.cvs.sourceforge.net/viewvc/*checkout*/php-java-bridge/php-java-bridge/examples/php%2Bjsp/jsp%2Bphp.jsp show how to invoke methods in a (remote-) PHP application server. The other example http://php-java-bridge.cvs.sourceforge.net/viewvc/*checkout*/php-java-bridge/php-java-bridge/examples/php%2Bjsp/jsr223.jsp shows how to execute a PHP script in the current application server. > Why could I not reference an actual script file? What do you mean with this? When running in a servlet environment, you can. Please see the example above. > I tested the example you gave and it worked but the application hung. Is > that normal? I am sorry, but I cannot reproduce this problem using PHP/Java Bridge 6.1.2.1. >> Btw to avoid confusion: The engine key PhpProcedure is the environment >> that >> has been passed to the java continuation via java_context()->call(ENV) -- >> continuations are modeled as procedures, that's why it's called >> "PhpProcedure" > > I don't follow: is there some other key I should have used? I'm missing the > point here. None. You could have used invokeFunction() as well. > I'm now trying to get PHPJavaBridge deployed on my Jetty test server. I've > got the following setup: > > Jetty > lib > ext > JavaBridge.jar > php-script.jar > php-servlet.jar > script-api.jar > webapps > JavaBridge.war > java > Java.inc > > So when I try to browse http://localhost:8080/JavaBridge I get: > > Cannot access /java within the current web directory. Please ask the jetty maintainer for support. I am not going to support this setup. You have the same libraries deployed at two locations, within the web app and in the ext directory. Please either remove the .jar files from the ext folder and try again. Or please use Tomcat, which supports running our class files from a shared loader quite well. I think jetty fails to pass the web app root directory to the classes loaded from ext. But I am not going to debug this server, especially since I know that it has some issues. Regards, Jost Bökemeier |