tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <>
Subject RE: dll already loaded in another classloader
Date Wed, 15 Sep 2004 12:21:40 GMT
Some ideas:
1. your webapp is loaded multiple times(multiple <Context>, same docBase),
thus loading your class multiple times.
2. your servlet is loaded multiple times(multiple <servlet> entries in
3. your webapp was reloaded through the manager

>From my experience, I found it worked best to put your java class that loads
your library in /common/lib and it will only be loaded once. But if you do
this, you will not be able to include this class in your war file. 

If you try to include it in your war file, your users can not use manager to
reload your app and you can not redeploy without restarting tomcat.

Also, you will need to rely on the user to put your dll on the system
path(windows) since you do not know the actual path where they may install


> -----Original Message-----
> From: Nathan O'Neal []
> Sent: Tuesday, September 14, 2004 7:03 PM
> To:
> Subject: dll already loaded in another classloader
> Hi All,
> My application loads a native library using System.load().  When I run
> Tomcat 5 through Eclipse, everything works fine on IE and Firefox.  But,
> when I run Tomcat normally I get this Exception with Firefox only:
> java.lang.UnsatisfiedLinkError: Native Library
> C:\jakarta-tomcat-5.0.28\webapps\profiler\WEB-INF\ttAdapterInfo.dll
> loaded in another classloader
> I've found that this is a "feature" of the jvm and it will not load the
> native library in different classloaders.  What I don't understand is why
> works when running through Eclipse, but not otherwise?
> On a side-note, where is the best place to put dll's when distributing a
> webapp as a war file?
> thanks,
> nathan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message