简体   繁体   English

java.lang.UnsatisfiedLinkError:本地库{____。dll}已经加载到另一个类加载器中

[英]java.lang.UnsatisfiedLinkError: Native Library {____.dll} already loaded in another classloader

I'm using a JAR file of my own, which uses a Java library (JHDF5), that in turn uses a dll through JNI. 我正在使用我自己的JAR文件,该文件使用Java库(JHDF5),而后者又通过JNI使用dll。 When I use my own JAR file in MATLAB, and then have to rebuild it while debugging, I get this error when I try to use it again, after calling clear java and creating a new object from my JAR file: 当我在MATLAB中使用我自己的JAR文件,然后在调试时必须重建它时,在我尝试再次使用它时,在调用clear java并从我的JAR文件创建一个新对象后,我收到此错误:

java.lang.UnsatisfiedLinkError: 
Native Library C:\deka\proj\java\ESPDF\dist\lib\jhdf5.dll 
already loaded in another classloader

and I can't solve it without shutting down MATLAB and reopening, which is a pain in the neck. 如果不关闭MATLAB并重新打开,我无法解决这个问题,这是一个痛苦的问题。

What is this error and whose fault is it? 这个错误是什么,它的错是什么? (mine? MATLAB's? JHDF5 for not freeing the DLL or checking to see if it's already loaded) (我的?MATLAB的?JHDF5没有释放DLL或检查它是否已经加载)

In general, there is no way for Java code to unload a native dll. 通常,Java代码无法卸载本机dll。 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5075039 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5075039

Given that, once a dll is loaded, it's there for the lifetime of the JVM and the VM will ensure that it is loaded once and only once. 鉴于此,一旦加载了dll,它就会存在于JVM的生命周期中,并且VM将确保它只加载一次且只加载一次。

To answer the question of blame, I suppose it's the fault of the code that attempts to load the dll without checking if its already available. 为了回答责备问题,我想这是代码的错误,它试图加载dll而不检查它是否已经可用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.UnsatisfiedLinkError:Native Library sqljdbc_auth.dll已经加载到另一个类加载器中 - java.lang.UnsatisfiedLinkError: Native Library sqljdbc_auth.dll already loaded in another classloader java.lang.UnsatisfiedLinkError: Native Library XXX.so 已经加载到另一个类加载器中 - java.lang.UnsatisfiedLinkError: Native Library XXX.so already loaded in another classloader 在Tomcat8中重新加载应用程序期间,java.lang.UnsatisfiedLinkError本机库已加载到另一个类加载器中 - java.lang.UnsatisfiedLinkError Native Library already loaded in another classloader during app reload in Tomcat8 java.lang.UnsatisfiedLinkError:本机库:{…} .dll已在另一个类加载器中加载 - java.lang.UnsatisfiedLinkError: Native Library: {…}.dll already loaded in another class loader java.lang.UnsatisfiedLinkError:本机库/usr/local/xuggler/lib/libxuggle-xuggler.so.3.4.1012已在另一个类加载器中加载 - java.lang.UnsatisfiedLinkError: Native Library /usr/local/xuggler/lib/libxuggle-xuggler.so.3.4.1012 already loaded in another classloader UnsatisfiedLinkError:本机库sunmscapi.dll已在另一个类加载器中加载 - UnsatisfiedLinkError: Native Library sunmscapi.dll already loaded in another classloader Android java.lang.UnsatisfiedLinkError与本机库 - Android java.lang.UnsatisfiedLinkError with native library 本机库sqljdbc_auth.dll已经加载到另一个类加载器中 - Native Library sqljdbc_auth.dll already loaded in another classloader java.lang.UnsatisfiedLinkError 在 java.library.path 中没有 *****.dll - java.lang.UnsatisfiedLinkError no *****.dll in java.library.path Java错误本机库已加载到另一个类加载器中 - Java error Native Library already loaded in another classloader
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM