On Wed, 13 Jun 2001, Felix von Delius wrote:

> I'm having trouble to bring the struts-example application to work with resin-1.2.7 
>under linux. With Win2K it runs just fine, but when doing the same installation under 
>linux, I always catch the exceptions appended at the end of this mail.
> 
> According to Scott Ferguson (developer of resin), this is a bug in struts, here a 
>quote from the resin mailinglist:
> 
> >It's a struts bug.
> >
> >The current struts code looks like:
> >
> >   Class clazz = Class.forName(actionClass);
> >
> >It should be rewritten to be:
> >
> >   ClassLoader loader = Thread.currentThread().getContextClassLoader();
> >   Class clazz = Class.forName(actionClass, true, loader);
> 
> Is this verified by someone else? Is this problem known to the struts people and 
>will it be fixed in the nightly build binary release?
> 

There's a current Bugzilla bug report about this
(http://nagoya.apache.org/bugzilla and then look up bug number 2009).  
I'm considering doing something about it (there are roughly five more
cases where you'd have to do the same thing), but I'd appreciate it if you
could verify something first.

Do you have struts.jar in your system classpath, instead of in
/WEB-INF/lib?  If so, that is *strictly* prohibited by the documentation,
and causes exactly the problem you are seeing.

The problem with relying on the context class loader is that, in a servlet
2.2 container, it is not *required* that this be the same as the web app
class loader (although this is very common).  Thus, making a change to use
it runs the risk of breaking existing applications on containers that
don't use the context class loader this way.

In servlet 2.3 (actually, in the J2EE 1.3 platform spec), it is likely
that the context class loader will be required to operate in a manner that
the above code would be safe.  Until then, though, I'm more than a little
hesitant.

> Thanks!
> 
> -Felix
> 

Craig McClanahan

Reply via email to