This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to resolve .dll already loaded in another classloader problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to resolve .dll already loaded in another classloader problem?" Watch "How to resolve .dll already loaded in another classloader problem?" New topic
Author

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

Ramesh kangamuthu
Ranch Hand

Joined: Mar 13, 2007
Posts: 79
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

Joined: Mar 22, 2005
Posts: 42954
    
  73
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.
 
I agree. Here's the link: http://kickstarter.com/rocket-mass-heater
 
subject: How to resolve .dll already loaded in another classloader problem?