|
From: <php...@li...> - 2008-02-03 12:45:32
|
Hi,
I have a very basic question regarding my installation and usage of
JavaBridge. Here is my setup:
Apache -----------------------------------
Tomcat
[Runs PHP
[Serving as back-end,
Scripts]
using mod_jk connectors]
I want to use PHP/Java Bridge to call Java Classes for some backend
operations. Following is my setup configuration:
OS: Windows XP
Apache: 2.2.6
PHP: 5.2.4
Tomcat: 5.0.24
I have done following under installation of JavaBridge:
1. Copied JavaBridge.war in webapps folder of tomcat.
2. Restarted Tomcat server.
3. I can access http://localhost/JavaBridge
4. Copied test.php into Apache/htdocs folder.
5. Access to http://localhost/test.php is giving following error:
*Warning*: fsockopen() expects parameter 2 to be long, string given in *
http://localhost/JavaBridge/java/Java.inc* on line *916*
*Fatal error*: Uncaught exception 'java_RuntimeException' with message
'Could not connect to the J2EE server localhost:. Please start it, for
example with the command: "java -jar JavaBridge.jar SERVLET:8080 3
JavaBridge.log" or, if the back end has been compiled to native code, with
"modules/java SERVLET:8080 3 JavaBridge.log". Error message: () ' in
http://localhost/JavaBridge/java/Java.inc:917 Stack trace: #0
http://localhost/JavaBridge/java/Java.inc(927): java_HttpHandler->open() #1
http://localhost/JavaBridge/java/Java.inc(1131):
java_HttpHandler->java_HttpHandler(Object(java_Protocol), '', 'localhost',
'') #2 http://localhost/JavaBridge/java/Java.inc(1170):
java_Protocol->createHttpHandler() #3
http://localhost/JavaBridge/java/Java.inc(1175):
java_Protocol->createHandler() #4
http://localhost/JavaBridge/java/Java.inc(364):
java_Protocol->java_Protocol(Object(java_Client)) #5
http://localhost/JavaBridge/java/Java.inc(1529): java_Client->java_Client()
#6 http://localhost/JavaBridge/java/Java.inc(1901): __javaproxy_Clien in *
http://localhost/JavaBridge/java/Java.inc* on line *917
*Pls suggest how to resolve this error. Do I need to run
JavaBridge.jarmanually? How can I make it get started automatically by
tomcat server?
Pls help!
Bharti
On Feb 2, 2008 8:46 PM, <php...@li...> wrote:
> Hi,
>
> > However, the only way I can instantiate a class of com.dang is by
> adding:
> >
> > java_autoload("D:\appz\java\dang.jar");
> >
> > after require_once("java/Java.inc");
>
> right. One must load a class before it can be used.
>
>
> > I need to confirm a call to com.dang through Tomcat:8080 without
> requiring local apache php
> > load.
>
> I am sorry, but I don't understand the above sentence.
>
> Do you want to use the static loader? All you need to do is to copy
> dang.jar to the tomcat
> WEB-INF/lib directory and re-start tomcat.
>
>
> Regards,
> Jost Boekemeier
>
>
>
> Lesen Sie Ihre E-Mails auf dem Handy.
> www.yahoo.de/go
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> 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...> - 2008-02-03 20:08:30
|
Hi,
>using mod_jk connectors
you must forward *all* requests to the back end or none. Please consult the mod_jk dokumentation
for details.
However, mod_jk is slow and very difficult to set up. A much better approach is to use mod_rewrite
or mod_proxy. Example httpd.conf:
ProxyPass /JavaBridge balancer://mycluster maxattempts=3
<Proxy balancer://mycluster>
BalancerMember http://diego:8080/JavaBridge
BalancerMember http://carlos:8080/JavaBridge
BalancerMember http://localhost:8080/JavaBridge
</Proxy>
Regards,
Jost Boekemeier
Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail
|
|
From: <php...@li...> - 2008-02-04 06:37:33
|
Thanx Jost for your reply.
I have disabled mod_jk and enabled mod_proxy as per your suggestion, but th=
e
problem is still the same. If I put test123.php under JavaBridge, it works
fine. But whereas if I put test123.php under Apache DocumentRoot, it still
gives me the same error. The code I am trying to execute in test123.php is
following:
<?php
if(!extension_loaded("java"))
require_once("http://localhost/JavaBridge/java/Java.inc");
$s =3D new Java("java.lang.String", "hello");
phpinfo();
?>
I am able to access http://localhost/JavaBridge and execute PHP scripts
under this app.
Is my desired setup configuration i.e. PHP scripts on Apache htdocs and
JavaClasses on Tomcat correct? What are the better alternatives to this
setup?
regds,
Bharti
On Feb 4, 2008 1:38 AM, <php...@li...> wrote=
:
> Hi,
>
> >using mod_jk connectors
>
> you must forward *all* requests to the back end or none. Please consult
> the mod_jk dokumentation
> for details.
>
> However, mod_jk is slow and very difficult to set up. A much better
> approach is to use mod_rewrite
> or mod_proxy. Example httpd.conf:
>
> ProxyPass /JavaBridge balancer://mycluster maxattempts=3D3
> <Proxy balancer://mycluster>
> BalancerMember http://diego:8080/JavaBridge
> BalancerMember http://carlos:8080/JavaBridge
> BalancerMember http://localhost:8080/JavaBridge
> </Proxy>
>
>
>
> Regards,
> Jost Boekemeier
>
>
> Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen
> Sie=B4s mit dem neuen Yahoo! Mail. www.yahoo.de/mail
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> 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...> - 2008-02-04 09:19:13
|
Hi
> require_once("http://localhost/JavaBridge/java/Java.inc");
the port number is missing. It should be:
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
or simply
require_once ("java/Java.inc");
Please re-read the README for details.
Regards,
Jost Boekemeier
Lesen Sie Ihre E-Mails jetzt einfach von unterwegs.
www.yahoo.de/go
|
|
From: <php...@li...> - 2008-02-04 09:23:44
|
Thanx a ton! It works for me!
regds,
Bharti
On Feb 4, 2008 2:49 PM, <php...@li...> wrote:
> Hi
>
> > require_once("http://localhost/JavaBridge/java/Java.inc");
>
> the port number is missing. It should be:
>
> require_once("http://localhost:8080/JavaBridge/java/Java.inc");
>
> or simply
>
> require_once ("java/Java.inc");
>
>
> Please re-read the README for details.
>
>
> Regards,
> Jost Boekemeier
>
>
>
> Lesen Sie Ihre E-Mails jetzt einfach von unterwegs.
> www.yahoo.de/go
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> 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...> - 2008-02-04 09:51:11
|
Sorry..Am a newbie runner and have another question to cut my time short!
Where shall I copy my own JARs that will be loaded using "java_autoload()"?
What kind of path definition needs to be given in this function call? Can
you give me or point me to some examples?
regds,
Bharti
On Feb 4, 2008 2:53 PM, Bharti Batra <bha...@gm...> wrote:
> Thanx a ton! It works for me!
>
> regds,
> Bharti
>
>
> On Feb 4, 2008 2:49 PM, <php...@li...>
> wrote:
>
> > Hi
> >
> > > require_once("http://localhost/JavaBridge/java/Java.inc");
> >
> > the port number is missing. It should be:
> >
> > require_once("http://localhost:8080/JavaBridge/java/Java.inc");
> >
> > or simply
> >
> > require_once ("java/Java.inc");
> >
> >
> > Please re-read the README for details.
> >
> >
> > Regards,
> > Jost Boekemeier
> >
> >
> >
> > Lesen Sie Ihre E-Mails jetzt einfach von unterwegs.
> > www.yahoo.de/go
> >
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > 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
> >
>
>
|