PHP calls the Java class Library and the custom Java class without the package through Javabridge successful but calls the custom Java class with the package error, how to solve, ask the big God, thank you
Source: Internet
Author: User
PHP calls the Java class Library through Javabridge and the custom Java class without the package succeeds but calls the custom Java class with the package error, how to solve, ask the big God pointing, thank you.
PHP calls the Java class Library and the custom Java class without the package successfully through Javabridge, but calls the custom Java class with the package for an error, and the fault log is as follows: Fatal error:uncaught [[o:exception]: " Java.lang.Exception:CreateInstance failed:new Cn.org.bjca.test.Test1. Cause:java.lang.ClassNotFoundException:Could not find Cn.org.bjca.test.Test1 in Java_require () path. Please check the path and the SEL and File permissions. VM: [email protected]://java.sun.com/] at: #-9 Php.java.bridge.DynamicJavaBridgeClassLoader.loadClass ( dynamicjavabridgeclassloader.java:278) #-8 JAVA.LANG.CLASS.FORNAME0 (Native Method) #-7 java.lang.Class.forName ( class.java:247) #-6 php.java.bridge.SimpleJavaBridgeClassLoader.forName (simplejavabridgeclassloader.java:158) #-5 Php.java.bridge.JavaBridge.CreateObject (javabridge.java:455) #-4 php.java.bridge.Request.handleRequest ( request.java:443) #-3 php.java.bridge.Request.handleRequests (request.java:481) #-2 Php.java.bridge.http.ContextRunner.run (contextrunner.java:145) #-1 Php.java.bridge.threadpool$delegate.run ( THREADPOOL.JAVA:60) #0 C:\Apache\htdocs\jaVa\java.inc (335): Java_throwexceptionproxyfactory->getproxy (1, NULL, ' Could not find ... ', false) #1 C:\Apache in C:\a Pache\htdocs\java\java.inc on line 298
Try to provide many methods on the Internet, have not been solved, and both Windows and Linux have this problem, do not know where the configuration error, please give suggestions, thank you.
PHP Version: 5.3.5
Apache Version: 2.2.2
Javabridge version: 5.4.4
------to solve the idea----------------------
Recently used php-java-bridge-6.2.1, encountered the same problem, the solution is as follows, to the landlord to do reference it.
Put the jar you want to use under your java/jre/lib/ext, the disadvantage is that you need to restart the server, the problem is OK.
Does the warrior know how to call Java successfully without restarting the server (which should be the JVM loading)?
------to solve the idea----------------------
The problem is mainly brutishness, I'm using the same version of Javabridge as you,
$here =realpath (dirname ($_server["Script_filename"));
Java_set_library_path ($here. Path_separator. '. '); Set the Java development package (class or JAR file) path, with multiple paths separated by Path_separator to ensure cross-leveling support.
You can see the introduction to this place http://blog.csdn.net/qq635785620/article/details/7522966
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.