Page 1 of 1

php-java bridge

Posted: Tue Apr 05, 2011 2:10 am
by cucucur
hello! I'm trying to install the php-java bridge, but it not easy!! I have some questions:

1. Function java_require, I found it in most of examples, this is what apache shows: Warning: java_require() not supported anymore, so, how can I include my java class??? in the same folder? I find it "dirty", I would prefer the java classes in different folder.

2. This is my example code, but it doesn't work

Code: Select all

<?php

     require_once("/var/lib/tomcat6/webapps/JavaBridge/java/Java.inc");
     //java_require('/var/www/prueba');
     $helloWorld = new Java('HelloWorld');
	 echo $helloWorld -> sayHello();
 ?>
It should write "hello world", but instead of that I have a lot of error:
Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new HelloWorld. Cause: java.lang.ClassNotFoundException: HelloWorld VM: 1.6.0_20@http://java.sun.com/" at: #-28 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) #-27 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) #-26 java.lang.Class.forName0(Native Method) #-25 java.lang.Class.forName(Class.java:264) #-24 php.java.bridge.Util.classForName(Util.java:1518) #-23 php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:445) #-22 php.java.bridge.Request.handleRequest(Request.java:458) #-21 php.java.bridge.Request.handleOneRequest(Request.java:510) #-20 php.java.servlet.PhpJavaServlet.handleLocalConnection(PhpJavaServlet.java:202) #-19 php.java.servlet.PhpJavaServlet.handlePut(PhpJavaServlet.java:250) #-18 php.java.servlet.PhpJavaServlet.doPut(PhpJavaServlet.java:261) #-17 javax.servlet.http.HttpServlet.service(HttpServlet.java:640) #-16 javax.servlet.http.HttpServlet.service( in /var/lib/tomcat6/webapps/JavaBridge/java/Java.inc on line 19
I can't understand if it is a code or an instalation problem. Could you help me??

Thank you in advance!

Re: php-java bridge

Posted: Tue Apr 05, 2011 3:53 am
by chunnilal
this is a java problem not a prob with PHP

Re: php-java bridge

Posted: Tue Apr 05, 2011 4:32 am
by cucucur
hello! I'm quite sure the problem is

Code: Select all

 java_require
, that does not exist, but I have no idea how to remplace it.

Thank you so much