tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Del Linz <>
Subject URLClassLoader and Reflection fail on Windows.
Date Tue, 13 May 2008 14:23:11 GMT
Dear All,
I have developed a webapp that loads dynamically java classes from jar 
files. Practically you put a jar file in a specified directory and the 
application will try to load a specified class from it. The application 
works with tomcat on Unix systems (both Linux and MacOSX) but it doesn't 
work on Windows system. I've tried to execute the code outside tomcat as 
standalone application and it works under Windows too.
To load jars I create an instance of URLClassLoader with the jar url as 
first argument and getClass().getClassLoader() as second argument (the 
parent class loader).
I catch the java.lang.ClassNotFoundException when I use my instance of 
URLClassLoader to load dynamically the class. I think that is a parent 
class loader problem, because it's the only difference between 
standalone and webapp runnings. Could someone help me to resolve that?
Thanks in advance,
Andrea Del Linz

View raw message