From: <php...@li...> - 2007-01-03 22:34:32
|
Am I doing something wrong when calling the java_context() function? I first tried to use java_context()->*getHttpServletResponse<http://php-java-bridge.sourceforge.net/pjb/server/documentation/API/php/java/servlet/Context.html#getHttpServletResponse%28%29> *() but that returned null. I then tried calling java_context()->getAttribute('javax.script.filename'), but that throws an Exception, complaining about Context.java:80. (stack trace pasted below) I've got sample code I can send to the mailing list of other want to try and duplicate it. I'm running Apache 2.2, PHP 5.2.0, Tomcat 5.5, and PHP/Java Bridge 3.2.1 java stack trace: [o(ByteArrayOutputStream):"java.lang.Exception: Invoke failed: [o(RemoteContext)]->getAttribute((String)o(String)). Cause: java.lang.NullPointerException Responsible VM: 1.6.0@http://java.sun.com/ at php.java.servlet.Context.getAttribute(Context.java:80) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1114) at php.java.bridge.Request.handleRequest(Request.java:342) at php.java.bridge.Request.handleRequests(Request.java:388) at php.java.bridge.http.ContextRunner.run(ContextRunner.java:188) at php.java.bridge.BaseThreadPool$Delegate.run(BaseThreadPool.java:66) Caused by: java.lang.NullPointerException ... 10 more "] |
From: <php...@li...> - 2007-01-04 16:24:24
|
Hi, > Am I doing something wrong when calling the > java_context() function? java_context() returns the current Java context. It is a JSR223 context if JSR223 is available. A servlet context, from which the servlet request, response, ... can be obtained, if PHP is running within a J2EE environment. Or a remote context when Java is accessed through a Apache or IIS front end or from a PHP command line binary: <?php require_once ("http://localhost:8080/JavaBridge/java/Java.inc"); $ctx = java_context(); $res = $ctx->getHttpServletResponse(); ?> In the above example $res is always null, unless the initial request came in through the tomcat port 8080. What do you want to do with the ServletRequest and ServletResponse objects anyway? When PHP is invoked from the command line or running within Apache/IIS, there's no servlet involved which could hold resonable values for the HTTP "GET/PUT/POST" method or URL parameters. > I first tried to use > java_context()->getHttpServletResponse [...] > [o(RemoteContext)]->... > *() but that returned null. Yes. RemoteContext always returns null for getHttpServletResponse etc. See http://php-java-bridge.cvs.sourceforge.net/php-java-bridge/php-java-bridge/server/php/java/servlet/RemoteContext.java?revision=1.1&view=markup > I then tried calling > java_context()->getAttribute This will not work either. The JSR223 functionality is only available if the bridge is running in a JSR223 environment: ScriptEngineManager m = new ScriptEngineManager(); ScriptEngine e = m.getEngineByName("php-invocable"); e.eval("<?php function f($p) {return 'hi '.$p;}?>"); Invocable i = (Invocable)e; Object o = i.invokeFunction("f", new Object[]{"Java"}); System.out.println(o); => hi Java Can you please explain what you want to do? Regards, Jost Boekemeier __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com |
From: <php...@li...> - 2007-01-04 16:42:50
|
VGhhbmtzLCBKb3N0LCBmb3IgdGhlIGRldGFpbGVkIHJlcGx5LiBJdCBoZWxwcyBtZSB1bmRlcnN0 YW5kIGJldHRlciBob3cgYWxsCm9mIHRoZXNlIGNvbXBvbmVudHMgYXJlIHdvcmtpbmcgdG9nZXRo ZXIuCgpJIGhhZCB0aG91Z2h0IHNpbmNlIHRoZSBKYXZhQnJpZGdlICp3YXMqIHJ1bm5pbmcgdW5k ZXIgVG9tY2F0IHRoYXQgSSBoYWQKYWNjZXNzIHRvIGV2ZXJ5dGhpbmcgYSBTZXJ2bGV0IHdvdWxk IGFzIHdlbGwuIEl0IHNlZW1zIHRoYXQgaXMgbm90IHRoZSBjYXNlCi0gYnV0IG5vdyBJJ20gbGVz cyBjZXJ0YWluIEkgdW5kZXJzdGFuZCB0aGUgZXhhY3QgcmVsYXRpb25zaGlwIGJldHdlZW4gUEhQ LAphIEphdmEgY2FsbCwgYW5kIFRvbWNhdC4KCldoeSBkbyBJIG5lZWQgdGhvc2UgamF2YV9jb250 ZXh0KCkgb2JqZWN0cz8KCkknbSB0cnlpb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VmIHN1cnZleXMg LSBhbmQgZWFybiBjYXNoCj4gaHR0cDovL3d3dy50ZWNoc2F5LmNvbS9kZWZhdWx0LnBocD9wYWdl PWpvaW4ucGhwJnA9c291cmNlZm9yZ2UmQ0lEPURFVkRFVgo+IF9fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fCj4gcGhwLWphdmEtYnJpZGdlLXVzZXJzIG1haWxp bmcgbGlzdAo+IHBocC1qYXZhLWJyaWRnZS11c2Vyc0BsaXN0cy5zb3VyY2Vmb3JnZS5uZXQKPiBo dHRwczovL2xpc3RzLnNvdXJjZWZvcmdlLm5ldC9saXN0cy9saXN0aW5mby9waHAtamF2YS1icmlk Z2UtdXNlcnMKPgo= |
From: <php...@li...> - 2007-01-04 17:00:59
|
James, The project you are working on definitely sounds like the type of =20 case study I want to see for the Web site to show other users (and =20 potential users) what can be done with PHP and Java using Jost's php/=20 Java bridge. Contact me when you are ready to share your project results. Jon Koerber php/Java bridge Web site admin jon...@us... On Jan 4, 2007, at 8:42 AM, php-java-bridge-=20 us...@li... wrote: > Thanks, Jost, for the detailed reply. It helps me understand better =20= > how all > of these components are working together. > > I had thought since the JavaBridge *was* running under Tomcat that =20 > I had > access to everything a Servlet would as well. It seems that is not =20 > the case > - but now I'm less certain I understand the exact relationship =20 > between PHP, > a Java call, and Tomcat. > > Why do I need those java_context() objects? > > I'm trying to use a set of Java classes that were designed to run as a > Servlet. (I want to use PHP to write the front-end pages and Java =20 > to do the > "heavy lifting" in the back.) > > My final call to one of the class methods is > $exportControl->processHttpdRequest($req, $resp, $servlet, null) > > This is supposed to write out the HTML (or other file data) =20 > directly to the > browser. The parameters it requires are the Servlet Request, =20 > Response, and > context objects. > > FWIW, if I can get this to work I'm writing it up as a case study =20 > for the > website. It's a non-trivial implementation of PHP and Crystal =20 > Reports that > can only be made to run by using the PHP/Java Bridge. > > - James > > On 1/4/07, php...@li... < > php...@li...> wrote: >> >> Hi, >> >>> Am I doing something wrong when calling the >>> java_context() function? >> >> java_context() returns the current Java context. It is >> a JSR223 context if JSR223 is available. A servlet >> context, from which the servlet request, response, ... >> can be obtained, if PHP is running within a J2EE >> environment. Or a remote context when Java is accessed >> through a Apache or IIS front end or from a PHP >> command line binary: >> >> <?php >> >> require_once >> ("http://localhost:8080/JavaBridge/java/Java.inc"); >> >> $ctx =3D java_context(); >> $res =3D $ctx->getHttpServletResponse(); >> ?> >> >> In the above example $res is always null, unless the >> initial request came in through the tomcat port 8080. >> >> What do you want to do with the ServletRequest and >> ServletResponse objects anyway? When PHP is invoked >> from the command line or running within Apache/IIS, >> there's no servlet involved which could hold resonable >> values for the HTTP "GET/PUT/POST" method or URL >> parameters. >> >> >>> I first tried to use >>> java_context()->getHttpServletResponse >> [...] >>> [o(RemoteContext)]->... >>> *() but that returned null. >> >> Yes. RemoteContext always returns null for >> getHttpServletResponse etc. See >> >> http://php-java-bridge.cvs.sourceforge.net/php-java-bridge/php-=20 >> java-bridge/server/php/java/servlet/RemoteContext.java?=20 >> revision=3D1.1&view=3Dmarkup >> >> >>> I then tried calling >>> java_context()->getAttribute >> >> This will not work either. The JSR223 functionality is >> only available if the bridge is running in a JSR223 >> environment: >> >> ScriptEngineManager m =3D new ScriptEngineManager(); >> ScriptEngine e =3D m.getEngineByName("php-invocable"); >> e.eval("<?php function f($p) {return 'hi '.$p;}?>"); >> Invocable i =3D (Invocable)e; >> Object o =3D i.invokeFunction("f", new >> Object[]{"Java"}); >> System.out.println(o); >> >> =3D> hi Java >> >> >> >> Can you please explain what you want to do? >> >> >> Regards, >> Jost Boekemeier >> >> >> __________________________________________________ >> Do You Yahoo!? >> Sie sind Spam leid? Yahoo! Mail verf=FCgt =FCber einen herausragenden = =20 >> Schutz >> gegen Massenmails. >> http://mail.yahoo.com >> >> ---------------------------------------------------------------------=20= >> ---- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to =20 >> share >> your >> opinions on IT & business topics through brief surveys - and earn =20 >> cash >> http://www.techsay.com/default.php?=20 >> page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV >> _______________________________________________ >> php-java-bridge-users mailing list >> php...@li... >> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users >> > ----------------------------------------------------------------------=20= > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to =20 > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?=20 > page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
From: <php...@li...> - 2007-01-04 22:14:32
|
Hi James, > I had thought since the JavaBridge *was* running > under Tomcat that I had > access to everything a Servlet would as well. Only if you access it through the servlet. Just direct your browser to port 8080 or set up mod_jk to forward everything to Tomcat. > - but now I'm less certain I understand the exact > relationship between PHP, > a Java call, and Tomcat. Well it's quite simple. If you call http://localhost:8080/JavaBridge/sessionSharing.jsp tomcat creates a servlet from the JSP file and i nvokes it. For PHP requests this is similar: http://localhost:8080/JavaBridge/sessionSharing.php invokes a servlet which creates the HTML pages and then delegates to PHP to fill in the content. If you call http://localhost/sessionSharing.php then Apache (or IIS) renders and returns the HTML page. Tomcat doesn't even see this request. > I'm trying to use a set of Java classes that were > designed to run as a > Servlet. (I want to use PHP to write the front-end > pages and Java to do the > "heavy lifting" in the back.) > > My final call to one of the class methods is > $exportControl->processHttpdRequest($req, $resp, > $servlet, null) This shouldn't be a problem. Just replace the JSP logic with PHP and you're done. Regards, Jost Boekemeier __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com |
From: <php...@li...> - 2007-01-04 22:59:21
|
A couple more questions, then... On 1/4/07, php...@li... < php...@li...> wrote: > > Hi James, > > > I had thought since the JavaBridge *was* running > > under Tomcat that I had > > access to everything a Servlet would as well. > > Only if you access it through the servlet. Just direct > your browser to port 8080 or set up mod_jk to forward > everything to Tomcat. Okay, that makes sense: pages called directly from my AS will of course be running in a Servlet context. > - but now I'm less certain I understand the exact > > relationship between PHP, > > a Java call, and Tomcat. > > Well it's quite simple. If you call > > http://localhost:8080/JavaBridge/sessionSharing.jsp > > tomcat creates a servlet from the JSP file and i > nvokes it. For PHP requests this is similar: > > http://localhost:8080/JavaBridge/sessionSharing.php > > invokes a servlet which creates the HTML pages and > then delegates to PHP to fill in the content. > > If you call > > http://localhost/sessionSharing.php > > then Apache (or IIS) renders and returns the HTML > page. > Tomcat doesn't even see this request. What if I call http://localhost/testJava.php and testJava.php file includes the (pure Java) PHP/Java bridge and makes a call on a new Java object. This behavior relies on the JavaBridge Servlet running in the AS (in my case: Tomcat). (This is setup in my php.ini, of course.) If the JavaBridge servlet is not running then the Java call(s) will fail. So in this instance, Tomcat *does* see the request, or at least the Java portions of it, but the java_context() isn't established(?). > I'm trying to use a set of Java classes that were > > designed to run as a > > Servlet. (I want to use PHP to write the front-end > > pages and Java to do the > > "heavy lifting" in the back.) > > > > My final call to one of the class methods is > > $exportControl->processHttpdRequest($req, $resp, > > $servlet, null) > > This shouldn't be a problem. Just replace the JSP > logic with PHP and you're done. Which I've done a lot of, and it seems to be working well. The issue though, is some of the Java classes I'm using want to write out (D)HTML using objects that exist in the Servlet context - obviously that won't work if being called from Apache -> PHP -> Tomcat Java/Bridge. I suppose my other option would be to run the PHP file from Tomcat instead of Apache... that may not be so bad, but it feels like then I'm just a step away from using pure Servlets + JSP and I could drop PHP entirely. :) Regards, > Jost Boekemeier > > > <https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users> |
From: <php...@li...> - 2007-01-05 16:46:59
|
Hi James, > What if I call > http://localhost/testJava.php > > and testJava.php file includes the (pure Java) > PHP/Java bridge and makes a > call on a new Java object. the bridge uses a named-pipe connection to call the JVM. The bridge calls the J2EE/Servlet back end only if a persistent connection doesn't exist or when the script contains java_session() call and the PHP instance doesn't have a session object. > course.) If the JavaBridge > servlet is not running then the Java call(s) will > fail. Well, yes. The pure PHP implementation currently doesn't use persistent connections. But that's an implementation detail. > So in this instance, Tomcat *does* see the request Yes, you're right. But the request/response objects created for the initial PUT request will vanish when the request is done. Furthermore they don't contain any usable values for you. If you really want to use PHP within Apache, you must fake a request/response pair, for example by using a Request/ResponseWrapper (see the J2EE servlet documentation). > The issue though, is some of the Java classes I'm > using want to write out > (D)HTML using objects that exist in the Servlet > context - obviously that > won't work if being called from Apache -> PHP -> > Tomcat Java/Bridge. It shouldn't be too difficult to write a ServletContextWrapper either. > I suppose my other option would be to run the PHP > file from Tomcat instead > of Apache... that may not be so bad, but it feels > like then I'm just a step > away from using pure Servlets + JSP and I could drop > PHP entirely. :) I don't think so. PHP, as an interpreted language, has many advantages over JSP. PHP doesn't need a development tool (a compiler) installed at run-time, it emmits clear error messages instead of obscure messages from the compiler ("compilation error in file bst_foo$__jsp.java ..."). Regards, Jost Boekemeier __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com |