You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Karsten Klein <Ka...@gmx.net> on 2005/12/04 13:20:17 UTC

axis2 classloading issue

Dear all,

I just migrated my project from axis2 0.92 to 0.93 and ran into a
Classloading issue. I'm deploying the axis2 service using Tomcat (5.0.28)
and it seems that classes referenced by my service implementation and that
are deployed as part of the my .aar file are not visible to the classloader
in place. 

To make the service work as anticipated I currently have to deploy the
referenced classes additionally in the web-inf/lib directory of the axis2
webapp.

That means that I have to package my service in two archive files at the
moment. The one containing all required classes for the service
implementation to function (and to be deployed in the axis2/WEB-INF/lib
folder). The second containing the axis2 service implementation class (and
deployed in the axis2/WEB-INF/services folder).

Can someone please comment on this issue. Is this working as anticipated?
Please consider, how this inflicts on the axis2 hot-deployment mechanism!! I
suppose, as soon as I have to touch the WEB-INF/lib folder hot-deployment of
axis2 is annulled!


Thanks,
Karsten


-- 
Highspeed-Freiheit. Bei GMX superg�nstig, z.B. GMX DSL_Cityflat,
DSL-Flatrate f�r nur 4,99 Euro/Monat*  http://www.gmx.net/de/go/dsl

Re: axis2 classloading issue

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hmm, this is somewhat confusing to me. Are you saying that the jars inside
the libs folder is not captured by the service class loader ? The
aar/lib/*.jars are *supposed to be* loaded into the service classloader and
this particular problem can only occur if you deliberately switch the
classloaders  ! Actually the idea of the service archive having the lib
folder is exactly to ship such third party libraries.

On 12/4/05, Srinath Perera <he...@gmail.com> wrote:
>
> Hi Karsten;
>
> If your service impl do not run on the same classloader as the
> classloader created for the aar file (with clasess and jars in the aar
> file), I guess it is a problem in Axis2.
>
> I agree if you need to touch the WEB-INF/lib .. hot deployment is gone.
>
> Please wait a bit if someone can give a quick fix, if not file a JIRA
>
> Thanks
> Srinath
>
> On 12/4/05, Karsten Klein <Ka...@gmx.net> wrote:
> > Dear all,
> >
> > I just migrated my project from axis2 0.92 to 0.93 and ran into a
> > Classloading issue. I'm deploying the axis2 service using Tomcat (5.0.28
> )
> > and it seems that classes referenced by my service implementation and
> that
> > are deployed as part of the my .aar file are not visible to the
> classloader
> > in place.
> >
> > To make the service work as anticipated I currently have to deploy the
> > referenced classes additionally in the web-inf/lib directory of the
> axis2
> > webapp.
> >
> > That means that I have to package my service in two archive files at the
> > moment. The one containing all required classes for the service
> > implementation to function (and to be deployed in the axis2/WEB-INF/lib
> > folder). The second containing the axis2 service implementation class
> (and
> > deployed in the axis2/WEB-INF/services folder).
> >
> > Can someone please comment on this issue. Is this working as
> anticipated?
> > Please consider, how this inflicts on the axis2 hot-deployment
> mechanism!! I
> > suppose, as soon as I have to touch the WEB-INF/lib folder
> hot-deployment of
> > axis2 is annulled!
> >
> >
> > Thanks,
> > Karsten
> >
> >
> > --
> > Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat,
> > DSL-Flatrate für nur 4,99 Euro/Monat*  http://www.gmx.net/de/go/dsl
> >
>



--
Ajith Ranabahu

Re: axis2 classloading issue

Posted by Srinath Perera <he...@gmail.com>.
Hi Karsten;

If your service impl do not run on the same classloader as the
classloader created for the aar file (with clasess and jars in the aar
file), I guess it is a problem in Axis2.

I agree if you need to touch the WEB-INF/lib .. hot deployment is gone.

Please wait a bit if someone can give a quick fix, if not file a JIRA

Thanks
Srinath

On 12/4/05, Karsten Klein <Ka...@gmx.net> wrote:
> Dear all,
>
> I just migrated my project from axis2 0.92 to 0.93 and ran into a
> Classloading issue. I'm deploying the axis2 service using Tomcat (5.0.28)
> and it seems that classes referenced by my service implementation and that
> are deployed as part of the my .aar file are not visible to the classloader
> in place.
>
> To make the service work as anticipated I currently have to deploy the
> referenced classes additionally in the web-inf/lib directory of the axis2
> webapp.
>
> That means that I have to package my service in two archive files at the
> moment. The one containing all required classes for the service
> implementation to function (and to be deployed in the axis2/WEB-INF/lib
> folder). The second containing the axis2 service implementation class (and
> deployed in the axis2/WEB-INF/services folder).
>
> Can someone please comment on this issue. Is this working as anticipated?
> Please consider, how this inflicts on the axis2 hot-deployment mechanism!! I
> suppose, as soon as I have to touch the WEB-INF/lib folder hot-deployment of
> axis2 is annulled!
>
>
> Thanks,
> Karsten
>
>
> --
> Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat,
> DSL-Flatrate für nur 4,99 Euro/Monat*  http://www.gmx.net/de/go/dsl
>

Re: axis2 classloading issue

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Karsetn;

I just checked that and It is working fine with me. Any way I can understand 
what the problem that you have encountered , you try to access or try to 
load the class at the run time which is in lib/*.jar (I am correct) , if so 
the right way is
  1. You need to get the correct AxisService (say you deploy service foo and 
at some where you need to use some resources in the archive file)
  2. Then take it class loader axisService.getClassLoader();
  3. Using that class loader load your classes or resources , rather than 
using Class.forname("resource_name");


Thanks,
 Deepal
................................................................
~Future is Open~

----- Original Message ----- 
From: "Karsten Klein" <Ka...@gmx.net>
To: <ax...@ws.apache.org>
Sent: Sunday, December 04, 2005 6:20 PM
Subject: axis2 classloading issue


> Dear all,
>
> I just migrated my project from axis2 0.92 to 0.93 and ran into a
> Classloading issue. I'm deploying the axis2 service using Tomcat (5.0.28)
> and it seems that classes referenced by my service implementation and that
> are deployed as part of the my .aar file are not visible to the 
> classloader
> in place.
>
> To make the service work as anticipated I currently have to deploy the
> referenced classes additionally in the web-inf/lib directory of the axis2
> webapp.
>
> That means that I have to package my service in two archive files at the
> moment. The one containing all required classes for the service
> implementation to function (and to be deployed in the axis2/WEB-INF/lib
> folder). The second containing the axis2 service implementation class (and
> deployed in the axis2/WEB-INF/services folder).
>
> Can someone please comment on this issue. Is this working as anticipated?
> Please consider, how this inflicts on the axis2 hot-deployment mechanism!! 
> I
> suppose, as soon as I have to touch the WEB-INF/lib folder hot-deployment 
> of
> axis2 is annulled!
>
>
> Thanks,
> Karsten
>
>
> -- 
> Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat,
> DSL-Flatrate für nur 4,99 Euro/Monat*  http://www.gmx.net/de/go/dsl
>