From: <php...@li...> - 2007-04-17 05:33:15
|
Error information: java stack trace: java.lang.Exception: Invoke failed: [[c:MultiThreadedExample]]->doit. Cause: java.lang.ClassNotFoundException: Unresolved external reference: java.lang.NoClassDefFoundError: MultiThreadedExample$GetThread. -- Unable to call the method, see the README section "Java platform issues" for details. Responsible VM: 1.5.0@ http://java.sun.com/ at php.java.bridge.JavaBridge.getUnresolvedExternalReferenceException( JavaBridge.java:496) at php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1135) at php.java.bridge.Request.handleRequest(Request.java:342) at php.java.bridge.Request.handleRequests(Request.java:388) at php.java.bridge.JavaBridge.run(JavaBridge.java:215) at php.java.bridge.BaseThreadPool$Delegate.run(BaseThreadPool.java :66) Caused by: java.lang.ClassNotFoundException: Unresolved external reference: java.lang.NoClassDefFoundError: MultiThreadedExample$GetThread. -- Unable to call the method, see the README section "Java platform issues" for details. ... 6 more Caused by: java.lang.NoClassDefFoundError: MultiThreadedExample$GetThread at MultiThreadedExample.doit(MultiThreadedExample.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1124) ... 4 more tm.php > <?php > $JAVA_LIB = 'file:/usr/solrapp/commons-logging-1.1.jar > ;file:/usr/solrapp/comm > try{ > java_require($JAVA_LIB); > $m = new JavaClass('MultiThreadedExample'); > $a = $m->doit(); > var_dump($a); > }catch (JavaException $ex){ > $trace = new Java("java.io.ByteArrayOutputStream"); > $ex->printStackTrace(new Java("java.io.PrintStream", > $trace)); > print "java stack trace: $trace\n"; > } > > ?> > MultiThreadedExample.java > import org.apache.commons.httpclient.HttpClient; > import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; > import org.apache.commons.httpclient.methods.GetMethod; > > /** > * An example that performs GETs from multiple threads. > * > * @author Michael Becke > */ > public class MultiThreadedExample { > > /** > * Constructor for MultiThreadedExample. > */ > public MultiThreadedExample() { > super(); > } > > public static void main(String[] args) { > > // Create an HttpClient with the > MultiThreadedHttpConnectionManager. > // This connection manager must be used if more than one thread > will > // be using the HttpClient. > > > } > > public static int[] doit(){ > int a[] = new int[50]; > HttpClient httpClient = new HttpClient(new > MultiThreadedHttpConnectionManager()); > // Set the default host/protocol for the methods to connect to. > // This value will only be used if the methods are not given an > absolute URI > httpClient.getHostConfiguration().setHost("jakarta.apache.org", > 80, "http"); > > // create an array of URIs to perform GETs on > String[] urisToGet = { > "/", > "/commons/", > "/commons/httpclient/", > "http://cvs.apache.org/viewcvs.cgi/jakarta-commons/httpclient/ > " > }; > > // create a thread for each URI > GetThread[] threads = new GetThread[urisToGet.length]; > for (int i = 0; i < threads.length; i++) { > GetMethod get = new GetMethod(urisToGet[i]); > get.setFollowRedirects(true); > threads[i] = new GetThread(httpClient, get, i + 1); > } > > // start the threads > for (int j = 0; j < threads.length; j++) { > threads[j].start(); > a[j] = threads[j].getResult(); > > } > return a; > } > /** > * A thread that performs a GET. > */ > static class GetThread extends Thread { > > private HttpClient httpClient; > private GetMethod method; > private int id; > private int num; > > public GetThread(HttpClient httpClient, GetMethod method, int id) > { > this.httpClient = httpClient; > this.method = method; > this.id = id; > } > > /** > * Executes the GetMethod and prints some satus information. > */ > public void run() { > > try { > > System.out.println(id + " - about to get something from " > + method.getURI()); > // execute the method > httpClient.executeMethod(method); > > System.out.println(id + " - get executed"); > // get the response body as an array of bytes > byte[] bytes = method.getResponseBody(); > this.num = bytes.length; > //System.out.println(id + " - " + bytes.length + " bytes > read"); > > } catch (Exception e) { > System.out.println(id + " - error: " + e); > } finally { > // always release the connection after we're done > method.releaseConnection(); > System.out.println(id + " - connection released"); > } > } > > public int getResult(){ > return this.num; > } > > } > > } > jar cvf m.jar Multi*.class and i add these .jar file is in class_path. i use freebsd6.2 . -- regards jl |
From: <php...@li...> - 2009-04-20 13:27:27
|
Hello, why do I get such an error message: root cause java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:List]]->addList([o:PhpParserString], [o:PhpParserString]). Cause: java.lang.NoSuchMethodException: addList([o:PhpParserString], [o:PhpParserString]). Candidates: [public java.util.ArrayList List.addList()] VM: 1.6.0_10@http://java.sun.com/" at: #-6 php.java.bridge.JavaBridge.checkM(JavaBridge.java:1119) #-5 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1057) #-4 php.java.bridge.Request.handleRequest(Request.java:414) #-3 php.java.bridge.Request.handleRequests(Request.java:490) #-2 php.java.bridge.http.ContextRunner.run(ContextRunner.java:146) #-1 php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:60) #0 http://localhost:8081/Ordner/java/Java.inc(248): java_ThrowExceptionProxyFactory->getProxy(3, 'List', 'addList([o:PhpP...', true) #1 http://localhost:8081/Ordner/java/Java.inc(388): java_Arg->getResult(true) #2 http://localhost:8081/Ordner/java/Java.inc(394): java_Client->getWrappedResult(true) #3 http://localhost:8081/Ordner/java/Java.i in http://localhost:8081/Ordner/java/Java.inc on line 215 php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.parseBody(FastCGIServlet.java:484) php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.doExecute(FastCGIServlet.java:379) php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:387) php.java.servlet.CGIServlet.handle(CGIServlet.java:399) php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:382) php.java.servlet.CGIServlet.doGet(CGIServlet.java:469) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) I use the method "addList" in my Java code.... |
From: <php...@li...> - 2007-04-17 09:08:30
|
Hi, > Unresolved external reference: > java.lang.NoClassDefFoundError: > MultiThreadedExample$GetThread. -- Unable to call > the method, see the README > section "Java platform issues" for details. you need to add the java library which exports a feature needed by MultiThreadedExample$GetThread. Most likely commons.[1] Please see the README section "Java platform issues" or our FAQ for details. Regards, Jost Boekemeier [1] Java's module concept is entirely insane. Microsofts .NET shows how to do this right... __________________________________ Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever |
From: <php...@li...> - 2007-04-17 09:28:41
|
thks 2007/4/17, php...@li... < php...@li...>: > > Hi, > > > Unresolved external reference: > > java.lang.NoClassDefFoundError: > > MultiThreadedExample$GetThread. -- Unable to call > > the method, see the README > > section "Java platform issues" for details. > > you need to add the java library which exports a > feature needed by MultiThreadedExample$GetThread. Most > likely commons.[1] > > Please see the README section "Java platform issues" > or our FAQ for details. > > > Regards, > Jost Boekemeier > > [1] Java's module concept is entirely insane. > Microsofts .NET shows how to do this right... > > > __________________________________ Yahoo! Clever: Stellen Sie > Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. > www.yahoo.de/clever > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > -- regards jl |