Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP/Java Bridge java.lang.NoSuchMethodException
    primarykey
    data
    text
    <p>I have setup PHP/Java Bridge with working examples in netbeans tomcat directory. What doesnt work is using custom JAR Here is my code:</p> <pre><code>package com.micha; public class Hello1Bean { public Hello1Bean() {} String hi() {return "This is my hello message";} String hello(String name) {return "Hello" + name;} } </code></pre> <p>And the php code </p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?php require_once ("java/Java.inc"); $world = new Java("com.micha.Hello1Bean"); echo java_values($world-&gt;hi()); echo "Hello Working Thingy\n\n"; ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>When I check <code>http://localhost:8084/JavaBridge/mytest.php</code>:</p> <pre><code> javax.servlet.ServletException: java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:Hello1Bean]]-&gt;hi. Cause: java.lang.NoSuchMethodException: hi(). Candidates: [] VM: 1.6.0_25@http://java.sun.com/" at: #-6 php.java.bridge.JavaBridge.checkM(JavaBridge.java:1085) #-5 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1024) #-4 php.java.bridge.Request.handleRequest(Request.java:417) #-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:\Users\Micha\.netbeans\7.1.2\apache-tomcat-7.0.22.0_base\webapps\JavaBridge\java\Java.inc(232): java_ThrowExceptionProxyFactory-&gt;getProxy(2, 'com.micha.Hello...', 'T', true) #1 C:\Users\Micha\.netbeans\7.1.2\apache-tomcat-7.0.22.0_base\webapps\JavaBridge\java\Java.inc(360): java_Arg-&gt;getResult(true) #2 C:\Users\Micha\.netbeans\7.1.2\apache-tomcat-7.0.22.0_base\webapps\JavaBridge\java\Java.inc(366): java_Client-&gt;getWrappedResult(true) #3 C:\Users\Micha\.netbean in C:\Users\Micha\.netbeans\7.1.2\apache-tomcat-7.0.22.0_base\webapps\JavaBridge\java\Java.inc on line 195 php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:499) php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393) php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126) </code></pre> <p>Before I had a ClassNotFoundException so it knows there is a a class but for some odd reason I cant call the function. ( if I replace "<code>com.micha.Hello1Bean</code>" with some class that doesnt exist then I get that exception)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload