EXCEPTION_ACCESS_VIOLATION when calling jni method in Weblogic
posted 11 years ago
I have inherited a piece of code that calls a DLL via JNI - this DLL in turn calls a proprietory VB DLL.
The code runs in an ejb on weblogic server - and previously worked fine when the jni methods were called from the ejb. If an exception occured in the DLL the exception was thrown correctly back to the ejb and dealt with appropriately.
However, if we needed to unload the DLL from memory for whatever reason - we needed to restart the whole of weblogic, which was not desirable. Because of this problem, my predecessor changed the code to add another layer. The part of the code that calls the DLL via JNI now exposes itself via RMI and the ejb in turn calls this. This allows us to redeploy the ejb and the DLL is unloaded and loaded correctly.
Now - getting around to my problem. In the new configuration - if an exception is thrown in the DLL, I now get an EXCEPTION_ACCESS_VIOLATION - causing the jvm to die and the whole weblogic server follows.
Nothing has changed in the code apart from the RMI split - DLLs and their interfaces to Java are still the same.
Thanks in advance Steve
ps. Not sure if this belongs in the J2EE forum - I thought it was more related to JNI so put it here.