You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ew...@vividsolutions.com on 2001/09/25 22:50:28 UTC

Resource Sharing

Hi all, 

I have an application that uses a JNI to a .dll file. I have since started
another application that I want to use the same .dll file but when I try to
run it I get the following error:

Exception Report:
Cannot allocate servlet instance for path
/mapstats/servlet/webade.sample.mapstas.MainServlet

Root Cause:
java.lang.UnsatisfiedLinkError: Native Library
C:\WINNT\system32\JWindows.dll already loaded in another classloader

I guess what I am wanting to know is, how I can get these two apps
to play nice together and share the .dll?

Thanks

Eric Wright, Programmer / Analyst
Vivid Solutions Inc. 
INTERNET : ewright@VividSolutions.com

Re: Resource Sharing

Posted by "Craig R. McClanahan" <cr...@apache.org>.
To make sure that your native code can be used from more than one web app,
you will need to ensure that it is loaded by a class that is also shared
across web apps.  The easiest way to do that is to put the class in a JAR
file under the "lib" directory.

Craig McClanahan


On Tue, 25 Sep 2001 ewright@vividsolutions.com wrote:

> Date: Tue, 25 Sep 2001 13:50:28 -0700
> From: ewright@vividsolutions.com
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: Resource Sharing
>
> Hi all,
>
> I have an application that uses a JNI to a .dll file. I have since started
> another application that I want to use the same .dll file but when I try to
> run it I get the following error:
>
> Exception Report:
> Cannot allocate servlet instance for path
> /mapstats/servlet/webade.sample.mapstas.MainServlet
>
> Root Cause:
> java.lang.UnsatisfiedLinkError: Native Library
> C:\WINNT\system32\JWindows.dll already loaded in another classloader
>
> I guess what I am wanting to know is, how I can get these two apps
> to play nice together and share the .dll?
>
> Thanks
>
> Eric Wright, Programmer / Analyst
> Vivid Solutions Inc.
> INTERNET : ewright@VividSolutions.com
>