tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Class.forName doesn't find classes located in WEB-INF/lib
Date Mon, 06 Jun 2011 22:08:06 GMT
> From: Clemens Eisserer [mailto:linuxhippy@gmail.com] 
> Subject: Class.forName doesn't find classes located in WEB-INF/lib

> I have a servlet which dynamically loads classes from jar-files
> located in WEB-INF/lib/,

Do you do your own classloading, or let Tomcat's classloaders do it?  If the former, why?

> Loading Application Class: Notepad
> java.lang.ClassNotFoundException: Notepad
>	at java.lang.Class.forName0(Native Method)
>	at java.lang.Class.forName(Class.java:186)
>	at net.java.openjdk.cacio.servlet.AppStarter.doGet(Unknown Source)

So what's going on inside your net.java.openjdk.cacio.servlet.AppStarter class?  What is the
current classloader set to?

> Any idea what could be the problem here?

Make sure you don't have Notepad.class in more than one place.

> Does tomcat use some kind of security manager which is blocking 
> class-loading?

Maybe.  (You might get a more definitive answer if you supplied more definitive information,
such as the Tomcat version you're using, where you got it from, and how you're starting it.
 If it didn't come from tomcat.apache.org, all bets are off.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

Mime
View raw message