tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Class.forName doesn't find classes located in WEB-INF/lib
Date Tue, 07 Jun 2011 08:54:18 GMT
On 06/06/2011 23:35, Clemens Eisserer wrote:
> Hi Martin,
> 
>> 3)webapp (everything found in WEB-INF/lib and WEB-INF/classes)
>>
>> you are using system classloader to loaf WEB-INF/lib jar
>> use the webapp classloader
> 
> So according to this, the servlet as well as the classes from
> WEB-INF/lib are loaded with the same classloader?
> What I did in the servlet was basically: this.getClass().forName("Notepad");
> 
> I've now changed the code to (where this refers to the Servlet):
> ClassLoader loader = this.getClass().getClassLoader();
> Class cls = loader.loadClass(className);
> 
> However loader in this case is null, any idea what is going on?

http://marc.info/?t=104265576200003&r=1&w=2
(which is linked from the Class Not Found FAQ which I'm guessing you
didn't read).

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message