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
web.xml)
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
it.

Charlie

> -----Original Message-----
> From: Nathan O'Neal [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 14, 2004 7:03 PM
> To: [EMAIL PROTECTED]
> 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
already
> loaded in another classloader
> 
> I've found that this is a "feature" of the jvm and it will not load the
same
> native library in different classloaders.  What I don't understand is why
it
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to