|
From: <php...@li...> - 2007-11-23 14:04:15
|
Hi, I'm working on an application that we took over from some other company, and it's based on Oracle Application Server (on Windows 2003 Server). In general, it's a mess in many ways, and on top of that we don't have a lot of experience in Java/J2EE, so we're trying to combine PHP with the existing codebase in order to leverage our PHP know-how. So, to make a long story short, we've managed to successfully install the PHP-Java Bridge v.3.2.1 with PHP 5.1.6 and the Oracle HTTP server (Apache 1.3) to the point where we can see the "java status" parameter as "running". However, all our tests immediately return the following error: Fatal error: php_mod_java(98): Call object is null: The connection to the current back end doesn't exist anymore; probably the current back end has been restarted w/o restarting the front end. in d:\www\javatest01.php on line 8 We assume this has to do with connecting to the wrong host/port, but we are at a loss in finding the right port. Attached is the report of ports in use by the Oracle Application Server. The "running" status cannot be obtained from 127.0.0.1:8888 or 127.0.0.1:7777. It usually works with ports 3701-4, but then we always get the error above. Any ideas? Thanks in advance |
|
From: <php...@li...> - 2007-11-23 14:09:29
|
Hi, I had the same problem running Tomcat and Apache - once you have the backend up and running, restart Apache - it worked for me. Regards, -- Jamie Saunders Interactive Developer Featurecreep Ltd. http://www.featurecreep.com 14 Orchard Street, Bristol, BS1 5EH +44 (0)117 905 5047 On 23 Nov 2007, at 14:04, php...@li... wrote: > Hi, > > I'm working on an application that we took over from some other > company, and > it's based on Oracle Application Server (on Windows 2003 Server). In > general, it's a mess in many ways, and on top of that we don't have > a lot of > experience in Java/J2EE, so we're trying to combine PHP with the > existing > codebase in order to leverage our PHP know-how. > So, to make a long story short, we've managed to successfully > install the > PHP-Java Bridge v.3.2.1 with PHP 5.1.6 and the Oracle HTTP server > (Apache > 1.3) to the point where we can see the "java status" parameter as > "running". > However, all our tests immediately return the following error: > > Fatal error: php_mod_java(98): Call object is null: The connection > to the > current back end doesn't exist anymore; probably the current back > end has > been restarted w/o restarting the front end. in d:\www > \javatest01.php on > line 8 > > We assume this has to do with connecting to the wrong host/port, > but we are > at a loss in finding the right port. Attached is the report of > ports in use > by the Oracle Application Server. The "running" status cannot be > obtained > from 127.0.0.1:8888 or 127.0.0.1:7777. It usually works with ports > 3701-4, > but then we always get the error above. Any ideas? > > Thanks in advance > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2007-11-23 14:51:20
|
Hi, unfortunately for me this doesn't work. I'm pretty sure something's messed up in the configuration of this particular OAS, because although in the http-we-site.xml the port mentioned is 8888, there appears to be no J2EE listener on that port. I've also installed the JavaBridge.war as described in the install.oracle file and I can see it is being expanded at runtime. However, I cannot access the http://localhost:8888/JavaBridge/test.php url. Could it be that the whole site is only accessible through HTTPS? Thanks for replying anyway :-) On Nov 23, 2007 3:09 PM, <php...@li...> wrote: > Hi, > > I had the same problem running Tomcat and Apache - once you have the > backend up and running, restart Apache - it worked for me. > > > Regards, > > -- > Jamie Saunders > Interactive Developer > > Featurecreep Ltd. > http://www.featurecreep.com > 14 Orchard Street, Bristol, BS1 5EH > +44 (0)117 905 5047 > > > On 23 Nov 2007, at 14:04, php...@li... > wrote: > > > > Hi, > > > > I'm working on an application that we took over from some other > > company, and > > it's based on Oracle Application Server (on Windows 2003 Server). In > > general, it's a mess in many ways, and on top of that we don't have > > a lot of > > experience in Java/J2EE, so we're trying to combine PHP with the > > existing > > codebase in order to leverage our PHP know-how. > > So, to make a long story short, we've managed to successfully > > install the > > PHP-Java Bridge v.3.2.1 with PHP 5.1.6 and the Oracle HTTP server > > (Apache > > 1.3) to the point where we can see the "java status" parameter as > > "running". > > However, all our tests immediately return the following error: > > > > Fatal error: php_mod_java(98): Call object is null: The connection > > to the > > current back end doesn't exist anymore; probably the current back > > end has > > been restarted w/o restarting the front end. in d:\www > > \javatest01.php on > > line 8 > > > > We assume this has to do with connecting to the wrong host/port, > > but we are > > at a loss in finding the right port. Attached is the report of > > ports in use > > by the Oracle Application Server. The "running" status cannot be > > obtained > > from 127.0.0.1:8888 or 127.0.0.1:7777. It usually works with ports > > 3701-4, > > but then we always get the error above. Any ideas? > > > > Thanks in advance > > ---------------------------------------------------------------------- > > --- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > 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: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |
|
From: <php...@li...> - 2007-11-23 15:02:56
|
Hi, the Oracle AS is (or was) actually a very good AS, please see: http://php-java-bridge.cvs.sourceforge.net/php-java-bridge/php-java-bridge/INSTALL.ORACLE?view=markup Can you please start the server with the command: cd $J2EE_HOME java -jar oc4j.jar and then run the test.php: http://localhost:8888/JavaBridge/test.php Which error message do you get? Regards, Jost Boekemeier Machen Sie Yahoo! zu Ihrer Startseite. Los geht's: http://de.yahoo.com/set |
|
From: <php...@li...> - 2007-11-23 15:18:30
|
Hi, I am not criticising OAS in general, but the way this particular application was implemented, it is really a mess and with my limited experience in Java/J2EE I can tell that a lot of things were not done in a standard way. Anyway, I tried to run the command as you suggested while all services were running and I got the following error: 07/11/23 16:07:19 Auto-deploying file:/D:/oracle/oraMtier/j2ee/home/applications /JavaBridge/ (New server version detected)... 07/11/23 16:07:20 Error starting HTTP-Server: Address already in use: JVM_Bind 07/11/23 16:07:21 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0) initialized Do I need to shut down one of the services before I run this command? I tried shutting down the HTTP server and then running the command again, but got the same message minus the "Auto-deploying" stuff. In both cases the url test.php does not work (404). Thank you so much for replying, and I apologize if my questions seem a little stupid, like I said, I don't have much experience in Java/J2EE. On Nov 23, 2007 4:02 PM, <php...@li...> wrote: > Hi, > > the Oracle AS is (or was) actually a very good AS, please see: > http://php-java-bridge.cvs.sourceforge.net/php-java-bridge/php-java-bridge/INSTALL.ORACLE?view=markup > > > Can you please start the server with the command: > > cd $J2EE_HOME > java -jar oc4j.jar > > and then run the test.php: > > http://localhost:8888/JavaBridge/test.php > > Which error message do you get? > > > Regards, > Jost Boekemeier > > > > Machen Sie Yahoo! zu Ihrer Startseite. Los geht's: > http://de.yahoo.com/set > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |
|
From: <php...@li...> - 2007-11-23 17:25:24
|
Hi
> 07/11/23 16:07:21 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)
I have just tested the bridge against Oracle AS 9.0.4 and I could not reproduce these problems.
1. downloaded/extracted oracle web containers for java (the 90MB download)
2. copied home/config to home/config-new
3. changed home/config-new/application.xml so that it contains
...
<web-module id="dms" path="../../home/applications/dms.war"/>
<web-module id="JavaBridge" path="../../home/applications/JavaBridge.war"/>
4. changed home/config-new/http-web-site.xml so that it contains
...
<web-app application="default" name="admin_web" root="/adminoc4j"/>
<web-app application="default" name="JavaBridge" root="/JavaBridge"/>
5. changed the server port in home/config-new/http-web-site.xml to 8899:
...
<web-site port="8899"
...
6. Copied JavaBridge.war (from the version 3.2.1 j2ee download) to home/applications
7. Started the Oracle J2EE server so that it runs with the new configuration:
java -jar '/home/jostb/Desktop/oc4j_extended.zip_FILES/j2ee/home/oc4j.jar'
-config '/home/jostb/Desktop/oc4j_extended.zip_FILES/j2ee/home/config-new/server.xml'
8. http://localhost:8899/JavaBridge/test.php renders the test PHP page.
If the problem persists, please open a problem report and attach your configuration
at the end of the ticket (please use the following link
http://sourceforge.net/tracker/?func=add&group_id=117793&atid=679233).
Regards,
Jost Boekemeier
Machen Sie Yahoo! zu Ihrer Startseite. Los geht's:
http://de.yahoo.com/set
|
|
From: <php...@li...> - 2007-11-27 19:11:48
|
Hello again, I downloaded the OAS 90MB download, installed it in a VM, followed your = instructions and everything worked for me there as well. Unfortunately, = it still didn't work in my application. Anyway, after a lot more of trials and errors, and just as I was about = to give up, it turns out that what I had to do to make it work in my = application was to inlclude the following line in the mod_oc4j.conf file = (included at the end of the Oracle/Apache httpd.conf): <IfModule mod_oc4j.c> ... Oc4jMount /JavaBridge home Oc4jMount /JavaBridge/* home </IfModule> This made everything work (along with a change to the default J2EE port, = which in my case was set differently). Another difference I noticed in my case was that the protocol specified = in the <web-site> directive was not "http", but "ajp13". I don't know if = this made any difference. Now, I only have one more question which is probably unrelated to the = bridge, but nevertheless I would appreciate it if anyone could answer. Is there any way I can include PHP code in JSP pages? I realize I = probably cannot put <?php ?> tags in a JSP page and expect them to be = parsed by PHP, but I tried including an external PHP file with <%@ = include file "/myscript.php"%> and <jsp:include page=3D"/myscript.php"/> = but it didn't work. I also tried <c:import url=3D"/myscript.php"/> but = it somehow didn't seem to be interpreted by Java (I got it back = literally in the html) which makes me think maybe my JSTL .jar file may = be out of date or something. Anyway, thanks again for going to great lengths to help Jost! :-) ----- Original Message -----=20 From: <php...@li...> To: <php...@li...> Sent: Friday, November 23, 2007 6:25 PM Subject: Re: [Php-java-bridge-users] Oracle Application Server problem > Hi >=20 >> 07/11/23 16:07:21 Oracle Application Server Containers for J2EE 10g = (9.0.4.0.0) >=20 > I have just tested the bridge against Oracle AS 9.0.4 and I could not = reproduce these problems. >=20 >=20 > 1. downloaded/extracted oracle web containers for java (the 90MB = download) >=20 > 2. copied home/config to home/config-new >=20 > 3. changed home/config-new/application.xml so that it contains > ... > <web-module id=3D"dms" path=3D"../../home/applications/dms.war"/> > <web-module id=3D"JavaBridge" = path=3D"../../home/applications/JavaBridge.war"/> >=20 > 4. changed home/config-new/http-web-site.xml so that it contains > ... > <web-app application=3D"default" name=3D"admin_web" = root=3D"/adminoc4j"/> > <web-app application=3D"default" name=3D"JavaBridge" = root=3D"/JavaBridge"/> >=20 > 5. changed the server port in home/config-new/http-web-site.xml to = 8899: > ... > <web-site port=3D"8899"=20 > ... >=20 > 6. Copied JavaBridge.war (from the version 3.2.1 j2ee download) to = home/applications >=20 > 7. Started the Oracle J2EE server so that it runs with the new = configuration: >=20 > java -jar = '/home/jostb/Desktop/oc4j_extended.zip_FILES/j2ee/home/oc4j.jar'=20 > -config = '/home/jostb/Desktop/oc4j_extended.zip_FILES/j2ee/home/config-new/server.= xml'=20 >=20 > 8. http://localhost:8899/JavaBridge/test.php renders the test PHP = page. >=20 >=20 > If the problem persists, please open a problem report and attach your = configuration > at the end of the ticket (please use the following link > = http://sourceforge.net/tracker/?func=3Dadd&group_id=3D117793&atid=3D67923= 3). >=20 >=20 > Regards, > Jost Boekemeier >=20 >=20 > Machen Sie Yahoo! zu Ihrer Startseite. Los geht's:=20 > http://de.yahoo.com/set >=20 > = -------------------------------------------------------------------------= > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2007-11-28 08:34:40
|
Hi,
if I understand the jk_mount directive, you now forward all requests to the oracle application
server.
> Is there any way I can include PHP code in JSP pages?
The bridge supports the JSR223 API. Which means that you could do the following (in pseudo code):
<%
javax.script.ScriptEngineManager m = new javax.script.ScriptEngineManager();
javax.script.ScriptEngine e = m.getEngineByName("php");
e.setOutputStream (out);
e.eval ("<?php echo 1+2 ?>");
%>
However, isn't it possible to run PHP on the Apache web server and to use the PHP/Java Bridge
protocol to connect to the Java back end?
Regards,
Jost Boekemeier
Jetzt Mails schnell in einem Vorschaufenster überfliegen. Dies und viel mehr bietet das neue Yahoo! Mail - www.yahoo.de/mail
|
|
From: <php...@li...> - 2007-11-30 12:29:15
|
Hi,
> The bridge supports the JSR223 API. Which means that you could do the following (in pseudo
> code):
the following code works with the pure Java implementation (PHP/Java Bridge version 4):
<%
out.print("hello from JSP");
javax.script.ScriptEngineManager m = new javax.script.ScriptEngineManager ();
javax.script.ScriptEngine e = m.getEngineByName ("php");
javax.script.ScriptContext c = e.getContext ();
java.io.Writer w=new java.io.FilterWriter(out){public void close()throws
java.io.IOException{flush();}};
c.setWriter (w);
e.eval ("<?php echo java_inspect(java_context());?>");
e.eval ("<?php $w=java_context()->getWriter(); $w->write(\"hello from PHP\"); $w->close();?>");
e.eval ("<?php phpinfo(); ?>");
%>
Note the FilterWriter above. It is needed because some versions close the output stream at the end
of the script.
Regards,
Jost Boekemeier
__________________________________ Ihr erstes Baby? Holen Sie sich Tipps von anderen Eltern. www.yahoo.de/clever
|