This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

An Error in loading .dll  RSS feed

krish rajini
Posts: 25
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have a webapp running under Tomcat 3.2.1 that needs to make JNI calls in
order to access data and methods in legacy C++ code. A servlet is loaded
startup of the webapp that, as part if its init method, causes a data set
specific to that webapp instance to be loaded into the C++ data
This Java code for this servlet contains the following:

try {
System.out.println("JCoreImpl loaded");
m_bLibraryLoaded = true;
} catch (UnsatisfiedLinkError e) {
m_bLibraryLoaded = false;
System.out.println("JCoreImpl NOT loaded " + e);

Things work fine if there is only one webapp (let's call it
If I have a second webapp ("webapps/bbb") that is identical to webapps/aaa
except for the data set used in the C++ data structures, then webapps/aaa
starts up just fine, but when webapps/bbb is started I get an error

JCoreImpl NOT loaded java.lang.UnsatisfiedLinkError: Native Library
E:\WebStation\binDebug\JCoreImpl.dll already loaded in another classloader

I need to have a separate instance of the native library for each of my
webapps as each instance needs to contain data that is unique to that
particular webapp. I have searched through the mail archives and read
emails by Craig McLanahan explaining the classloader hierarchy. But I
not been able to find anything specific to loading a unique instance of a
native library for each webapp.

Any ideas? Thanks,


ujjwal soni
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Report post to moderator
Repeated post
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!