How to unload Dll in java?

2019-03-31 01:53发布

I have written a Java agent in Lotus Notes 8.5 to reset token's PIN using IAIKPKCS11wrapper. When the agent is loaded for the first time it worked fine. But after I close and restart the agent then it failed. Checking the console output I discovered the following error:

Exception in thread "AgentThread: JavaAgent" java.lang.UnsatisfiedLinkError: pkcs11wrapper (Library is already loaded in another ClassLoader)

I have searched the group but the closest I could find is that it is not possible to unload the DLL library but I still have no idea how to handle it.

Can anyone point me the solution?

标签: java dll
2条回答
我欲成王,谁敢阻挡
2楼-- · 2019-03-31 02:44

Try adding the jar to your Lotus Notes classpath in notes.ini:

JavaUserClasses=...;yourAgent.jar

or copy your jar to the default Notes lib directory, which should be something like: C:\lotus\notes\jvm\lib\ext

Another thing to try is to put your dll in C:\lotus\notes.

查看更多
做个烂人
3楼-- · 2019-03-31 02:49

From one of the related SO questions, found this tutorial on DLL unloading.

查看更多
登录 后发表回答