Re: URLClassLoader interesting behaviour...
dushkin wrote:
Tom wrote:
Then I guess both classes will already be available, and your new class
loader wont get a look in. You need to separate out the classes to a
different location.
...
So you mean that I must put each jar in a seperate folder???
No. Tom did not mean putting the jar's in different
directories, he meant putting the XML files in different
paths within the Jar files.
..Is it mandatory?
Well.. let me put it this way.
If you had two Jars on the classpath, one with an XML
file at path..
The1st.jar!/com/mycompany/the.xml
..the second with an XML file at path..
The2nd.jar!/com/mycompany/the.xml
..how is the classloader supposed to know which
one is required?
Perhaps more relevant, is that your initial code
shows only one jar added to the URLClassLoader
(UCL). If both jars are on the classpath at runtime,
the UCL is not needed - it should be possible to
obtain resources from them using the default
classloader. Why are you creating the UCL at all?
--
Andrew Thompson
http://www.athompson.info/andrew/
Message posted via http://www.javakb.com