Hi Deepal, Thanks for your answer. This is what I thought too about the classloader mechanism. However in my case I really have a class conflict and axis2 is using the classes loaded in /web-inf/lib. My problem comes from the geronimo-javamail that doesn't implement all the specification and thus I receive UnsupportedOperationException whereas the sun distribution is located under
myService |_lib I am deploying axis2 under Tomcat. Thanks, Arnaud > -----Original Message----- > From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 05, 2006 6:21 AM > To: axis-user@ws.apache.org > Subject: Re: [AXIS2] Classloader problem > > Hi ; > > Axis2 service classloaders work in child first scenario by > default , what that mean is it load classes from child class > loader before loading from parent class loader, so according > to ur picture , if there is some class in foo.jar inside > myService.aar then for the service it will use class in > myService.aar/lib/foo.jar not from web-inf/lib/foo.jar. > > So you dont need to do anything to get this is done , by > default Axis2 does the class loading as you require. > > > > Arnaud Blandin wrote: > > >Hi, > > > >I am sure you have been discussing about this problem in the > past but I > >couldn't find the relevant thread. > >I apologize in advance if I am describing a known problem. > > > >I am currently building a service on top of AXIS2. This service is > >using classes that are conflicting with the classes distributed with > >the Axis2 web app. > >The service is deployed as an aar file in the service > directory of the > >axis2 web application. > > > >My question is simple: how can I ensure that the ClassLoader > tries to > >load first the classes packaged in my lib directory from the aar > >instead of looking at the 'lib' directory of the axis2 webapp. > > > >|_WEB-INF > > |_lib > > |_foo.jar > > |_services > > |_myService.aar > > |_lib > > |_foo.jar > > > >I want to ensure that my service looks first for the > >myService.aar/lib/foo.jar As a workaround I tried to set the > following > >with no luck before invoking the Skeleton: > > > >ClassLoader previous = > Thread.currentThread().getContextClassLoader(); > >ClassLoader loader = msgContext.getAxisService().getClassLoader(); > >Thread.currentThread().setContextClassLoader(loader); > > > >Thanks, > > > >Arnaud > > > > > > > > > > > > -- > Thanks, > Deepal > ................................................................ > ~Future is Open~ > > >