You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by David Haraburda <da...@haraburda.com> on 2001/07/20 08:44:12 UTC
PATCH - AdaptiveClassLoader.java
Hi,
This is a patch for AdaptiveClassLoader -- it fixes the problem(s) I've
described in my previous post. In short:
The API documentation for java.lang.ClassLoader states that subclasses
of ClassLoader should implement the findResource and findResources
method. I've added these methods to AdaptiveClassLoader, and fixed up
getResource. What happens is that when the final method getResources on
java.lang.ClassLoader is called, (as is the case for
javax.naming.InitialContext when it searches for jndi.properties), it
calls findResources on the current instance of the ClassLoader. Becuase
AdaptiveClassLoader does not override this method, the default
implementation is called, which returns null. With this patch, the web
application classes and lib directory will be searched, as I would
assume correct behaivor to be.
This patch is against the 3.2.3 source tarball I downloaded when it was
first released a couple of days ago.
Also -- as I stated in a previous post there was a patch for this
submitted awhile back, but it did not get committed and I could find no
explanation why. My patch does the same thing, although it is a bit
simplier, and only changes this one file. If this cannot be committed I
would appreciate knowing the reason why, and also would like any
suggestions on what to do with a jndi.properties file in my
WEB-INF/classes directory.
Thanks,
David
--
David Haraburda - david@haraburda.com
Everest - Helping You Manage Outsourcing
972-980-0013 x736