Problem Loading a native dll.
Hi,
I use two native libraries in my application this are loaded in the class that implement each one:
static {
System.loadLibrary("TreuJavaPdf");
}
in a class and in other:
static {
System.loadLibrary("TreuJavaExcel");
}
My problem is that after accesing a TreuJavaPdf without problems I try access to TreuJavaExcel I get a exception (Access Denied). Doing the things in reverse order I get a exception accesing to TreuJavaPdf(access Denied). Any Idea?.
Thanks in advance!!
Salvador.
[561 byte] By [
SaTreua] at [2007-11-26 18:36:07]

# 1
SaTreu,
Sounds to me like the two dlls share some resource, which the first one used locks and then is unavailable to the second used. Assuming that you don't need the first one initialized when you need the second, it would be worth checking if they have some kind of clean-up function in the dlls. This would ideally release all resources and allow the second one to have it. This of course is assuming that the loading of both was possible without error. You didn't mention any problems with loading them both, so I assume there were none.
Unloading either from the Java side is an iffy proposition since the JNI Spec says that unloading involves getting the classloader and loading class garbage collected.
Jim