From: <php...@li...> - 2012-07-12 09:26:09
|
Hi It states that there is an mismatch between your input parameters and the expected parameters in the method. Why are you creating the parameters (by the way it's new java...) in PHP. Why not create a Java side wrapper where you instantiate the input/outputstream? Something like callProcessHtml(String filename) and then do the call to ProcessHtml from there? Hermod -----Opprinnelig melding----- Fra: php...@li... [mailto:php...@li...] Sendt: 12. juli 2012 10:27 Til: php...@li... Emne: [Php-java-bridge-users] IllegalArgumentException problem Hi; I set up Tomcat and JavaBridge.war as described in the documentation. I have JavaBridge application under webapps directory. All examples work fine. Then I copied my PHP scripts into JavaBridge and custom .jar files into JavaBridge/WEB-INF/lib. I get the following exceptions whenever I try to create an instance of a Java class. [[o:Exception]:"java.lang.Exception: CreateInstance failed: new net.windward.xmlreport.ProcessHtml((o:InputStream)[c:FileInputStream], (o:OutputStream)[c:ByteArrayOutputStream]). Cause: java.lang.IllegalArgumentException: argument type mismatch VM: 1.7.0_05@http://java.oracle.com/" at: #-9 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) #-8 sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) #-7 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) #-6 java.lang.reflect.Constructor.newInstance(Unknown Source) #-5 php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:487) #-4 php.java.bridge.Request.handleRequest(Request.java:458) #-3 php.java.bridge.Request.handleRequests(Request.java:500) #-2 php.java.bridge.http.ContextRunner.run(ContextRunner.java:145) #-1 php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:60) #0 C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\JavaBridge\java\Java.inc(232): java_ThrowExceptionProxyFactory->getProxy(3, 'java.io.ByteArr...', 'T', false) #1 C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\JavaBridge\java\Java.inc(360): java_Arg->getResult(false) #2 C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\JavaBridge\java\Java.inc(363): java_Client->getWrappedResult(false) #3 C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\JavaBridge\java\Java.inc(535): java_Client->getInternalResult() #4 C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\JavaBridge\java\Java.inc(1929): java_Client->createObject('net.windward.xm...', Array) #5 C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\JavaBridge\sample\classes\ProcessHtml.php(41): Java->Java('net.windward.xm...', Object(JavaClass), Object(JavaClass)) Java->#6 C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\JavaBridge\sample\runreport.php(34): ProcessHtml::CreateWithTemplateReport(Object(JavaClass), Object(JavaClass)) #7 {main}] Could someone help me to resolve this issue? I can't figure out why the exception is thrown. An instance of the ProcessHtml class created like this new Java("net.windward.xmlreport.ProcessHtml", $template, $report); the constructor of net.windward.xmlreport.ProcessHtml class accepts two parameters: java.io.InputStream and java.io.OutputStream. $template and $report are created like this $template = java("java.io.FileInputStream", "/path/to/a/file"); $report = java("java.io.ByteArrayOutputStream"); Sincerely, Igor Kolesnik ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DNB Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DNB Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |