tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Walters <>
Subject specifying ClassLoader for webapp
Date Thu, 27 Jun 2002 21:32:59 GMT

I've written a JNI based layer for a large 
native code executable to allow extensions 
to the native code application to be 
written in Java. When the executable 
starts, it creates a Java VM and loads 
several infrasturcture Java classes.  
These classes load a shared library as 
part of their initialization which allow 
the Java extension code to call back into 
the native code.  All this has worked very 

I've also embedded Tomcat 4.0.3 into the 
application successfully using the 
CatalinaService class.  I'm running into a 
problem though, when I try to use the 
infrastructure classes from my jsp bean to 
make calls back into the native code.  
Since my initial ClassLoader from when I 
created the Java VM has already loaded the 
shared library,  I get the following 

javax.servlet.ServletException: Native 
Library F:\Java\DLL\JNIXfer.dll already 
loaded in another classloader

Is there a way to enable Tomcat's webapp 
classloader to find these infrastructure 
classes that were already loaded by the 
other Classloader?  I tried setting the 
parent loader in the Catalina class to my 
initial loader but that didn't seem to 
have any effect.  I don't mind making 
minor Tomcat source changes if that's what 
it takes to fix it.

Scott Walters

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message