From: <php...@li...> - 2006-10-08 17:35:56
|
Hello. I've been trying to figure this out for a few days now, and I'm so totally stuck that I really need to ask for help before I go nuts. I have a .jar file with the following information given in the documentation: ----------------------------------------- example.jar java.lang.Object | +- example.client.ExampleRequest Method: public static ExampleResult execute(java.lang.String ID, java.lang.String Name, java.lang.String PW, java.lang.String extraParam1, java.lang.String extraParam2, java.lang.String extraParam3) ----------------------------------------- ... and the installation instructions say it needs to go here: /opt/example/lib/ Question: How do I call the execute() method and pass it the parameters it needs? I always get "java.lang.NoSuchMethodException" even though the method definitely exists. Is it because I'm not calling it correctly? 1) If my PHP code is this: java_require("/opt/example/lib/example.jar"); $example = new Java("example.client.ExampleRequest"); $result = $example->execute('123', 'John Doe', 'myPassword'); I get this in the Error log: java.lang.NoSuchMethodException: execute(o(Request$PhpParserString), o(Request$PhpParserString), o(Request$PhpParserString)). Candidates [public static example.client.ExampleRequest.execute(java.lang.String,java.lang.String,java .lang.String)] at php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1007) at php.java.bridge.Request.handleRequest(Request.java:467) at php.java.bridge.Request.handleRequests(Request.java:493) at php.java.bridge.JavaBridge.run(JavaBridge.java:209) at php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:29) [client 123.456.789.012] PHP Warning: java.lang.Exception: Invoke failed: [c(ExampleRequest)]->execute(o(Request$PhpParserString), o(Request$PhpParserString), o(Request$PhpParserString)). Cause: java.lang.NoSuchMethodException: execute(o(Request$PhpParserString), o(Request$PhpParserString), o(Request$PhpParserString)). Candidates [public static example.client.ExampleRequest.execute(java.lang.String,java.lang.String,java .lang.String)] in /var/www/html/test.php on line 3 2) Or if I try this in my PHP: java_require("/opt/example/lib/example.jar"); $example = new Java("example.client.ExampleRequest"); $id = new Java('java.lang.String', '123'); $name = new Java('java.lang.String, 'John Doe'); $pw = new Java('java.lang.String', 'myPassword'); $result = $example->execute($id, $name, $pw); This code gives the same error message, except that o(Request$PhpParserString) is replaced with o(String). Can anyone see what I'm doing wrong? Thanks. -Kevin |