From: <php...@li...> - 2006-10-15 23:49:16
|
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 |