-
1. Re: JNI calls in MBean
sgturner Dec 21, 2002 6:33 PM (in response to sokto)You ask Jndi for an RMIConnector to the MBeanServer. Then you invoke methods on MBeans by using the invoke method of the MBeanServer. Details are in the Admin Guide
-
2. Re: JNI calls in MBean
davidjencks Dec 25, 2002 4:48 PM (in response to sokto)As far as I know there is nothing preventing jni calls from an mbean. You can only deploy a native library once, which makes including it in a redeployable java package problematical.
My experiments with hot deploying a half-java half-native (closed source) driver eventually failed due to the native library loading code in the java part ot the driver, but got far enough that I suspect that you have not successfully deployed the native library. -
3. Re: JNI calls in MBean
andygodwin Dec 27, 2002 12:12 PM (in response to sokto)UnsatisfiedLinkError means the VM can't find your native
library ... the library must be on the system path, not
the classpath.
Generally, using JNI in MBeans is fine, but, as David
says, you can't redeploy a native library ... that's
a VM issue, nothing to do with JBoss. If you do need
to, you can always write a simple wrapper library that
just loads and unloads your real library in response
to the MBean start and stop service methods. -
4. Re: JNI calls in MBean
andygodwin Dec 27, 2002 1:53 PM (in response to sokto)UnsatisfiedLinkError means the VM can't find your native
library. A native library must be on the system path,
not the classpath, in order to be found.
Generally, JNI in MBeans works fine, but, as David said,
you can't redeploy a native library ... that's a VM
issue, nothing to do with JBoss. If you do need this,
tho, you can always write a simple wrapper library that
loads and unloads your real library in the MBean start
and stop service methods. -
5. Re: JNI calls in MBean
andrewrcollins Jan 4, 2003 6:53 AM (in response to sokto)> Generally, using JNI in MBeans is fine, but, as
> David says, you can't redeploy a native library
> ... that's a VM issue, nothing to do with JBoss.
> If you do need to, you can always write a simple
> wrapper library that just loads and unloads your
> real library in response to the MBean start and
> stop service methods.
How would you write such a load/unload wrapper? -
6. Re: JNI calls in MBean
adrian.brock Jan 5, 2003 12:05 PM (in response to sokto)AFAIK the problem with hotdeploying JNI is that
you cannot reload the library until the referencing
class is garbage collected.
Something that is hard to control.
This should not stop one-time deployment.
Regards,
Adrian -
7. Re: JNI calls in MBean
andygodwin Jan 15, 2003 5:34 AM (in response to sokto)In Win32 land, LoadLibrary() and FreeLibrary() do the
job ... don't know about any other platforms.