From: <php...@li...> - 2014-06-27 12:10:43
|
Hi everyone!!!! I would like to ask how to call a java class from php. After research on internet, I’ve following a tutorial who tells me to put my project in jar file and to put it on Tomcat/webapps/myproject/WEB-INF/lib. And then to call it on my php script with <?php require_once("java/Java.inc"); $obj = new Java('HelloWorld'); ?> But it doesn’t work. I have followed the jee documentation with javabridge.zip too. I put my project in .war file and put the .jar into Tomcat/webapps then it deployed my project. After that, I create php file and put this script <?php define("JAVA_HOSTS", 127.0.0.1:8080); define("JAVA_SERVLET", "/JavaBridge/servlet.phpjavabridge"); require_once("java/Java.inc"); echo java("java.lang.System")->getProperties(); ?> PS I’m working on Apache for php and Tomcat for java. Both don’t work. Need help , please. Thanks. Finoana |
From: <php...@li...> - 2014-06-28 06:47:57
|
My set up that is working is using Tomcat for the container, once installed in webapps, all I have to do is call it thusly: require_once("http://localhost:8080/JavaBridge/java/Java.inc"); and I can use java classes. Hope that helps. --Nathan On Friday, June 27, 2014 7:11 AM, "php...@li..." <php...@li...> wrote: Hi everyone!!!! I would like to ask how to call a java class from php. After research on internet, I’ve following a tutorial who tells me to put my project in jar file and to put it on Tomcat/webapps/myproject/WEB-INF/lib. And then to call it on my php script with <?php require_once("java/Java.inc"); $obj = new Java('HelloWorld'); ?> But it doesn’t work. I have followed the jee documentation with javabridge.zip too. I put my project in .war file and put the .jar into Tomcat/webapps then it deployed my project. After that, I create php file and put this script <?php define("JAVA_HOSTS", 127.0.0.1:8080); define("JAVA_SERVLET", "/JavaBridge/servlet.phpjavabridge"); require_once("java/Java.inc"); echo java("java.lang.System")->getProperties(); ?> PS I’m working on Apache for php and Tomcat for java. Both don’t work. Need help , please. Thanks. Finoana ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
From: <php...@li...> - 2014-07-01 09:28:53
|
Hi!!! Can you tell me please where do you put your java project to call it from php. Because I got this error Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new HelloWorld. Cause: java.lang.ClassNotFoundException: HelloWorld VM: 1.7.0_60@http://java.oracle.com/" at: #-36 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) #-35 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) #-34 java.lang.Class.forName0(Native Method) #-33 java.lang.Class.forName(Class.java:270) #-32 php.java.bridge.Util.classForName(Util.java:1518) #-31 php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:445) #-30 php.java.bridge.Request.handleRequest(Request.java:458) #-29 php.java.bridge.Request.handleOneRequest(Request.java:510) #-28 php.java.servlet.PhpJavaServlet.handleLocalConnection(PhpJavaServlet.java:202) #-27 php.java.servlet.PhpJavaServlet.handlePut(PhpJavaServlet.java:250) #-26 php.java.servlet.PhpJavaServlet.doPut(PhpJavaServlet.java:261) #-25 javax.servlet.http.HttpServlet.service(HttpServlet.java:649) #-24 javax.servlet.http.HttpServlet.servi in http://localhost:8080/JavaBridge/java/Java.inc on line 195 Thank you so much. Finoana Le 28 juin 2014 à 08:47, php...@li... a écrit : > My set up that is working is using Tomcat for the container, once installed in webapps, all I have to do is call it thusly: > > require_once("http://localhost:8080/JavaBridge/java/Java.inc"); > > and I can use java classes. > > Hope that helps. > > --Nathan > > > > On Friday, June 27, 2014 7:11 AM, "php...@li..." <php...@li...> wrote: > > > > Hi everyone!!!! > > I would like to ask how to call a java class from php. > > After research on internet, I’ve following a tutorial who tells me to put my project in jar file and to put it on Tomcat/webapps/myproject/WEB-INF/lib. And then to call it on my php script with > <?php > require_once("java/Java.inc"); > $obj = new Java('HelloWorld'); > ?> > > But it doesn’t work. > > I have followed the jee documentation with javabridge.zip too. I put my project in .war file and put the .jar into Tomcat/webapps then it deployed my project. After that, I create php file and put this script > <?php > define("JAVA_HOSTS", 127.0.0.1:8080); > define("JAVA_SERVLET", "/JavaBridge/servlet.phpjavabridge"); > require_once("java/Java.inc"); > echo java("java.lang.System")->getProperties(); > ?> > PS I’m working on Apache for php and Tomcat for java. > > Both don’t work. > > Need help , please. > > Thanks. > > Finoana > ------------------------------------------------------------------------------ > Open source business process management suite built on Java and Eclipse > Turn processes into business applications with Bonita BPM Community Edition > Quickly connect people, data, and systems into organized workflows > Winner of BOSSIE, CODIE, OW2 and Gartner awards > http://p.sf.net/sfu/Bonitasoft > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > ------------------------------------------------------------------------------ > Open source business process management suite built on Java and Eclipse > Turn processes into business applications with Bonita BPM Community Edition > Quickly connect people, data, and systems into organized workflows > Winner of BOSSIE, CODIE, OW2 and Gartner awards > http://p.sf.net/sfu/Bonitasoft > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
From: <php...@li...> - 2014-07-02 00:17:52
|
I put JavaBridge.war in the tomcat/webapps folder. That's the only step I did before this was working as I described. You can get the .war file here: http://sourceforge.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_6.2.1/php-java-bridge_6.2.1_documentation.zip/download --Nathan On Tuesday, July 1, 2014 4:29 AM, "php...@li..." <php...@li...> wrote: Hi!!! Can you tell me please where do you put your java project to call it from php. Because I got this error Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new HelloWorld. Cause: java.lang.ClassNotFoundException: HelloWorld VM: 1.7.0_60@http://java.oracle.com/" at: #-36 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) #-35 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) #-34 java.lang.Class.forName0(Native Method) #-33 java.lang.Class.forName(Class.java:270) #-32 php.java.bridge.Util.classForName(Util.java:1518) #-31 php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:445) #-30 php.java.bridge.Request.handleRequest(Request.java:458) #-29 php.java.bridge.Request.handleOneRequest(Request.java:510) #-28 php.java.servlet.PhpJavaServlet.handleLocalConnection(PhpJavaServlet.java:202) #-27 php.java.servlet.PhpJavaServlet.handlePut(PhpJavaServlet.java:250) #-26 php.java.servlet.PhpJavaServlet.doPut(PhpJavaServlet.java:261) #-25 javax.servlet.http.HttpServlet.service(HttpServlet.java:649) #-24 javax.servlet.http.HttpServlet.servi in http://localhost:8080/JavaBridge/java/Java.inc on line 195 Thank you so much. Finoana Le 28 juin 2014 à 08:47, php...@li... a écrit : > My set up that is working is using Tomcat for the container, once installed in webapps, all I have to do is call it thusly: > > require_once("http://localhost:8080/JavaBridge/java/Java.inc"); > > and I can use java classes. > > Hope that helps. > > --Nathan > > > > On Friday, June 27, 2014 7:11 AM, "php...@li..." <php...@li...> wrote: > > > > Hi everyone!!!! > > I would like to ask how to call a java class from php. > > After research on internet, I’ve following a tutorial who tells me to put my project in jar file and to put it on Tomcat/webapps/myproject/WEB-INF/lib. And then to call it on my php script with > <?php > require_once("java/Java.inc"); > $obj = new Java('HelloWorld'); > ?> > > But it doesn’t work. > > I have followed the jee documentation with javabridge.zip too. I put my project in .war file and put the .jar into Tomcat/webapps then it deployed my project. After that, I create php file and put this script > <?php > define("JAVA_HOSTS", 127.0.0.1:8080); > define("JAVA_SERVLET", "/JavaBridge/servlet.phpjavabridge"); > require_once("java/Java.inc"); > echo java("java.lang.System")->getProperties(); > ?> > PS I’m working on Apache for php and Tomcat for java. > > Both don’t work. > > Need help , please. > > Thanks. > > Finoana > ------------------------------------------------------------------------------ > Open source business process management suite built on Java and Eclipse > Turn processes into business applications with Bonita BPM Community Edition > Quickly connect people, data, and systems into organized workflows > Winner of BOSSIE, CODIE, OW2 and Gartner awards > http://p.sf.net/sfu/Bonitasoft > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > ------------------------------------------------------------------------------ > Open source business process management suite built on Java and Eclipse > Turn processes into business applications with Bonita BPM Community Edition > Quickly connect people, data, and systems into organized workflows > Winner of BOSSIE, CODIE, OW2 and Gartner awards > http://p.sf.net/sfu/Bonitasoft > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |