-
1. Re: JNI and JBOSS???
adrian.brock Apr 21, 2003 1:13 PM (in response to alexjboss)Write an MBean that does the
System.loadLibrary("whatever");
You are correct, you shouldn't be doing this
by spec.
Regards,
Adrian -
2. Re: JNI and JBOSS???
haraldgliebe Apr 22, 2003 8:50 AM (in response to alexjboss)Actually JARDeployer resp. its super class SubDeployerSupport does that already.
SubDeployerSupport calls System.load(..) for every dynamic library found in a jar file that is deployed. However, since the call to System.load is in SubDeployerSupport (which is not loaded by UCL) the native library is associated with the wrong classloader and thus unusable for the code in the deployed jar file.
What is the use case of this deployment of native libraries in SubDeployerSupport? Has it worked before? -
3. Re: JNI and JBOSS???
jbossalex Apr 24, 2003 12:25 AM (in response to alexjboss)Hi :
I loaded the native dll library using the MBEAN approach, but I am still getting unsatisfied link errors.
I called System.loadLibrary() in a static initializer in my MBEAN:
static
{
try
{
//loads the project_api.dll
System.out.println("....................STARTING LOADING THE DLL");
System.loadLibrary("project_api");
System.out.println("....................FINISHED LOADING THE DLL");
}
catch(UnsatisfiedLinkError unsatisfiedlinkerror)
{
String lErrorMsg = "Native project_api code library failed to load.\n";
System.out.println(lErrorMsg + unsatisfiedlinkerror.getMessage());
System.exit(1);
}
Can anyone refer me to an example of using an MBEAN to load a Native Library or provide me with any ideas? By the way, I implemented a Standard MBEAN.
I then called my MBEAN from my Stateful Session EJB and once again I received an UnsatisfiedLink Exception.
Many Thanks:
Alex