From: <php...@li...> - 2010-04-12 15:25:50
|
Hi Jost. Let me tell you that I resolved the problem creating a WS using directly JAVA because I don´t know why Javabridge can not read the JAR file. A JAVA programmer help me with this problem. Thank very much for all your answers and your time. Regards. Date: Fri, 9 Apr 2010 18:04:48 +0200 From: php...@li... Subject: Re: [Php-java-bridge-users] USING JAR To: php...@li... Message-ID: <s2o...@ma...> Content-Type: text/plain; charset=UTF-8 Hi, > Following your instructions this is the result of > IS: > [[o:Exception]:"java.lang.Exception: CreateInstance failed: new prepago. > Cause: java.lang.ClassNotFoundException: prepago please see our FAQ entry "Why do I get a ClassNotFoundException?" at: <http://php-java-bridge.sourceforge.net/pjb/FAQ.html> http://php-java-bridge.sourceforge.net/pjb/FAQ.html Documentation about Java jar files can be found at <http://en.wikipedia.org/wiki/JAR_%28file_format%29> http://en.wikipedia.org/wiki/JAR_%28file_format%29 Regards, Jost B?kemeier De: Berlington Barnett [mailto:bba...@gm...] Enviado el: domingo, 04 de abril de 2010 9:54 Para: 'php...@li...' Asunto: RE: USING JAR Hi Jost. Following your instructions this is the result: [[o:Exception]:"java.lang.Exception: CreateInstance failed: new prepago. Cause: java.lang.ClassNotFoundException: prepago VM: 1.6.0_18@http://java.sun.com/" at: #-10 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1516) #-9 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1361) #-8 java.lang.Class.forName0(Native Method) #-7 java.lang.Class.forName(Unknown Source) #-6 php.java.bridge.Util.classForName(Util.java:1536) #-5 php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:391) #-4 php.java.bridge.Request.handleRequest(Request.java:453) #-3 php.java.bridge.Request.handleRequests(Request.java:491) #-2 php.java.bridge.http.ContextRunner.run(ContextRunner.java:140) #-1 php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:60) #0 C:\Apache Software Foundation\Tomcat 6.0\webapps\JavaBridge\java\Java.inc(223): java_ThrowExceptionProxyFactory->getProxy(1, NULL, 'T', false) #1 C:\Apache Software Foundation\Tomcat 6.0\webapps\JavaBridge\java\Java.inc(349): java_Arg->getResult(false) #2 C:\Apache Software Foundation\Tomcat 6.0\webapps\JavaBridge\java\Java.inc(352): java_Client->getWrappedResult(false) #3 C:\Apache Software Foundation\Tomcat 6.0\webapps\JavaBridge\java\Java.inc(522): java_Client->getInternalResult() #4 C:\Apache Software Foundation\Tomcat 6.0\webapps\JavaBridge\java\Java.inc(1881): java_Client->createObject('prepago', Array) #5 C:\Apache Software Foundation\Tomcat 6.0\webapps\JavaBridge\prepagoice.php(24): Java->Java('prepago') #6 {main}] If you need the jar file, please give an email to send it you. Thank you very much for all you help Regards J Hi, > PHP Fatal error: Uncaught [...] I was asking for the result of this code: try { $prepago = new java("prepago"); } catch (Exception $e) { echo $e; } Anyway, the error message contains enough information this time. > [[o:Exception]:"java.lang.Exception: CreateInstance failed: new prepago. Cause: java.lang.ClassNotFoundException: prepago VM: 1.6.0_18@ href="http://java.sun.com/" target="_new">http://java.sun.com/" [...] Please see our FAQ entry "Why do I get a ClassNotFoundException?". > The problem with the jar file is that I dont know how to open it, You can open java archives with "winzip" on Windows. On Linux or Solaris you can right-click on the jar and select "Open with ArchiveManager ..." If you mean that you don't know how to use it, well, please see the API documentation which you should have received with the library. Assuming your class name is "foo.bar.baz.Prepago" and it contains a public method called "something", you can call the method with: $p = new java("foo.bar.baz.Prepago"); $p->something(); But I am sure you already know this, if you have read the PHP/Java Bridge API documentation. Regards, Jost Bökemeier |