Hello!
I seem to have the PHP Java Bridge (php-java-bridge_3.0.7a) working with PH=
P
5.1.2 on my CentOS server with Apache 2.0.53. I think all configuration is
OK, but it still has some problem at run-time.
When the php page is loaded, everything is OK. But when i refresh the page,
it shows the error as below
*Fatal error*: Uncaught [o(Exception):"java.lang.Exception: CreateInstance
failed: new StreamFountJava.SFountAPI. Cause: java.lang.UnsatisfiedLinkErro=
r:
Native Library /usr/lib/libsfount_api.so already loaded in another
classloader"] thrown in */home/mbos/php_java.php* on line *10*
StreamFountJava.SFountAPI is a java package. I have made the
StreamFountJava/SFountAPI.class as *.jar and stored it under
/usr/share/java/. Also the *.jar is in my java_require() path.
libsfount_api.so is the dynamic link libraries for the java to invoke.
It has been loaded by System.loadLibrary() in the SFountAPI.class.
This is the php-java-bridge.log:
Mar 10 16:09:22 JavaBridge ERROR: Exception occured
java.lang.UnsatisfiedLinkError: Native Library /usr/lib/libsfount_api.so
already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1551)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1482)
at java.lang.Runtime.load0(Runtime.java:737)
at java.lang.System.load( System.java:811)
at StreamFountJava.SFountAPI.<clinit>(SFountAPI.java:24)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance (
NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java :274)
at php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:515)
at php.java.bridge.Request.handleRequest(Request.java:406)
at php.java.bridge.Request.handleRequests(Request.java:425)
at php.java.bridge.JavaBridge.run(JavaBridge.java:207)
at php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:29)
Why every time i refresh my page, the Fatal error will be shown? How can i
release my dynamic link libraries from the classloader or avoid the error?
I also try to use java_reset() at the top of my php page, but it seems that
it doesn't work.
I'm sorry for my poor english, because english is not my native language.
But trust me, I'm trying my best. Please help me anyway!
Best regards to you!
Thank you!
|