axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: AxisClassLoader patch
Date Wed, 26 Sep 2001 12:48:48 GMT
Ravi Kumar wrote:
> 
> Glen,
> 
> What you are saying sounds the right thing, but .....
> 
> How do you get hold of the servlet classloader for the webapp in an
> implementation independent  way?
> 
> Is it possible apart from using Foo.class.getClassLoader() where Foo is loaded
> by the above mentioned class loader.

Axis servlet needs to add the following to doGet() and doPost():

------------------------------ Snip from CocoonServlet -----------------------------------
        /* HACK for reducing class loader problems.                                     */
        /* example: xalan extensions fail if someone adds xalan jars in tomcat3.2.1/lib */
        try {
            Thread.currentThread().setContextClassLoader(classLoader);
        } catch (Exception e){}
------------------------------------ End Snippet -----------------------------------------

> 
> Rgds
> ravi
> 
> Glen Daniels wrote:
> 
> > Hi Ravi!
> >
> > Your patch precisely reverses a change I made some weeks ago. :)  And no,
> > it's not the right thing, IMO.  We need to figure out the real solution to
> > the classloader issue sometime soon - if indeed we do want custom
> > classloaders, we need to make sure that the parent classloader of our custom
> > one is either exactly the servlet classloader for the webapp in question
> > (which already is set up with the right classpath), or a URLClassLoader
> > which we've forced to point to the right places.  The
> > Thread.currentThread().getContextClassloader() should take care of the
> > former, since the AxisClassLoader should get instantiated as a result of a
> > hit on a servlet.
> >
> > --Glen
> >
> > ----- Original Message -----
> > From: "Ravi Kumar" <rkumar@borland.com>
> > To: <axis-dev@xml.apache.org>
> > Sent: Tuesday, September 25, 2001 5:02 PM
> > Subject: Re: AxisClassLoader patch
> >
> > > Any of you had a chance to look at this?
> > >
> > > Ravi
> > >
> > >
> > > Ravi Kumar wrote:
> > >
> > > > Oops, sorry! Forgot the attachement.
> > > >
> > > > [[ I guess trying to do stuff late on a friday evening ain't good <g>]]
> > > >
> > > > Ravi.
> > > >
> > > > Ravi Kumar wrote:
> > > >
> > > > > Problem:
> > > > > If the axis context classes and libraries are exclusively present
only
> > > > > under WEB-INF, the servlet engine should be able to work. But it
> > > > > doesn't. To make it work it's required to add the axis classes and
> > > > > libraries to the servlet engine's class path. The above is true with
> > > > > Tomcat 3.2 and a build of Axis from CVS.
> > > > >
> > > > > Reason:
> > > > > AxisClassLoader appears to have a bug in the way it determines the
> > > > > current class loader.
> > > > >
> > > > > Fix:
> > > > > I have changed it  (fixed AxisClassLoader attached)
> > > > >
> > > > > from
> > > > > **** Thread.currentThread().getContextClassLoader()
> > > > > to
> > > > > **** AxisClassLoader.class.getClassLoader();
> > > > >
> > > > > Rationale:
> > > > > The AxisClassLoader itself is present under WEB-INF, Whichever class
> > > > > loader loaded it, has the correct classpath and will be able to load
> > the
> > > > >
> > > > > rest of the stuff there.
> > > > >
> > > > > Comments? Am I way off?
> > > > >
> > > > > Regards
> > > > > Ravi
> > > > > JBuilder R&D
> > > >
> > >
> >   ------------------------------------------------------------------------
> > > >                            Name: AxisClassLoader.java
> > > >    AxisClassLoader.java    Type: JavaScript Program
> > (application/x-javascript)
> > > >                        Encoding: 7bit
> > >

Mime
View raw message