Do you use Class.forName("MyClass") to load classes anywhere?  If so, your 
libraries in WEB-INF/lib or WEB-INF/classes that attempt to load the 
caching library in TOMCAT_HOME/lb (called TOMCAT_HOME/shared/lib in 4.1.x) 
or TOMCAT_HOME/common/lib won't be able to find it because that package was 
loaded in a different classloader.

Replace:

Class.forName("MyClass")

With:

Thread.currentThread().getContextClassLoader().loadClass("MyClass")

That will find classes and resources across multiple classloaders like 
those that Tomcat provides.

Note that there could be one other issue.  There are some classloading 
problems that have been fixed in the latest 4.0.4 beta and the 4.1.3 
beta.  I *highly* suggest you drop 4.0.3 like a bad habit and move to a bug 
fixed release.  You will save yourself a *ton* of grief by doing so.  I 
wouldn't worry too much that they are marked as beta.  As far as I've been 
able to tell, 4.1.3 is quite robust and same with the latest beta of 4.0.4.

Jake


At 10:13 PM 6/10/2002 -0600, you wrote:
>I am deploying several web applications  which access data through the 
>proxy/facade pattern into EJB's.  Some of this data is shared across 
>applications.  I have 1 jar file that is shared, and handles some in 
>memory caching of data, etc.  In tomcat 3.3, I have this jar in the 
>lib/apps directory, and I don't have to bundle it in any of the 
>WEB-INF/lib directories.  For some reason, I always get ClassNotFound 
>Exceptions doing the same thing in 4.0.3.  Tomcat 4.0.3 wants me to have 
>the jar in every WEB-INF/lib directory.   I have tried dropping it in 
>common/lib, lib, server/lib, everything.  Is there something I am not 
>quite understanding here, or does tomcat 4.x.x load classes differently? I 
>really wanted to use 4.0.x because my AppResources now is combined and in 
>the classpath because my 3.3 doesn't find anything in the WEB-INF/classes 
>directories of my web-apps....
>
>Thanks
>
>Nic Holbrook
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to