Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to resolve .dll already loaded in another classloader problem?

 
Ramesh kangamuthu
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

In my Java project, I need to use native dll file to access MS Outlook items for that I used Java Outlook Connector (third party API).But often I face the following problem .dll already loaded in another classloader when I use the statements

System.setProperty("java.library.path","D:/kramesh/JocServices/src/java/outlookservices")
System.loadLibrary("moyocore")

Can anybody help me to solve the problem?

Thank you for your valuable help

Best Regards,

Ramesh K
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I vaguely recall that a JVM will load a specific DLL only once, and will not unload it even if the associated classloader is GCed.

That means the DLL would need to be loaded by a classloader ALL classes have access to, like the system classloader.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic