From: <php...@li...> - 2006-10-16 16:46:25
|
Hi again. I am replying to my own question post since a friend of mine helped me track down my NoClassDefFound problem (thanks Russell). The error is in the java_require's at the beginning of my code. I needed to use the format java_require(JAR1;JAR2;JAR3;JAR4); instead of separating the requires. There is cross calling in the classes in the 4 libraries I use so they must all be brought into the same memory space. See the following reference for full details: http://php-java-bridge.sourceforge.net/documentation/PHP-API/html/ java_8c.html#doc23 I read this before, but it didn't rally gel in my brain until I was reminded of how libraries are cached by the back-end loader. Jon On Oct 15, 2006, at 4:49 PM, php-java-bridge- us...@li... wrote: > Hullo all. > > Well I am slowly getting closer to converting a sample java class > from our processing companies API (for credit card transactions) > into a woring PHP script using php-java bridge. Thanks for all the > helpful tips I received so far. > > I am currently stuck with an error when calling a particular method > of a class from the JAR file I included at the top of my script. > > MY CODE > ========= > java_require("/Library/WebServer/Documents/cj/simapi-java-5.0.0/lib/ > cybsclients15.jar"); > java_require("/Library/WebServer/Documents/cj/simapi-java-5.0.0/lib/ > cybssecurity.jar"); > java_require("/Library/WebServer/Documents/cj/simapi-java-5.0.0/lib/ > xercesImpl.jar"); > java_require("/Library/WebServer/Documents/cj/simapi-java-5.0.0/lib/ > xml-apis.jar"); > > // Set up var with the class for generating the charge request > $reply_class = new JavaClass("com.cybersource.ws.client.Client"); > // create new hashmap variable to use for results > $reply = new JavaClass("java.util.HashMap"); > $reply = java_util_hashMap(); > $reply = $reply_class->runTransaction($request, $props); > > RESULTS > ======== > [o(Exception):"java.lang.Exception: Invoke failed: [c(Client)]- > >runTransaction((Map)o(HashMap), (Properties)o(Properties)). Cause: > java.lang.ClassNotFoundException: Unresolved external reference: > java.lang.NoClassDefFoundError: com/cybersource/security/exception/ > SecuritySystemException. -- Unable to call the method, see the > README section "Java platform issues" for details. Responsible VM: > 1.5.0_06@http://apple.com/" at: #-6 > php.java.bridge.JavaBridge.getUnresolvedExternalReferenceException > (JavaBridge.java:481) #-5 php.java.bridge.JavaBridge.Invoke > (JavaBridge.java:1084) #-4 php.java.bridge.Request.handleRequest > (Request.java:499) #0 [internal function]: Java->__call > ('runTransaction', Array) #1 /Library/WebServer/Documents/cj/simapi- > java-5.0.0/samples/nvp/AuthCaptureSample.php(114): JavaClass- > >runTransaction(Object(JavaArray), Object(JavaArray)) #2 {main}] > > > Looking back at the docs for the Bridge, it says that if you get a > "NoClassDefFound" error it means there is another class that the > current class is trying to reference or call that is missing (so > the Client->runTransaction is missing something). > > Does this mean that the four java_require statements at the top of > my PHP script do not contain the missing class? These are all the > JAR files that were provided as part of this API package from our > card processing company. > > If it means that there is some other JAR I need a java_require for, > how do I go about finding what JAR I should include??? > > Thanks, > > Jon > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642______________________________ > _________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |