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 ban19 <br...@gmail.com> on 2009/03/26 21:37:07 UTC
Re: Re: classloading question with axis2 and jboss
I just ran into a similar problem today due to a client set-up running both
Axis and Axis2 in Tomcat-- basically I need to override a class from Axis
with one from Axis2 in order to deploy my service. Geronimo seems to have
ways to overcome this by using "hidden-classes" (maybe? haven't really used
it); however, I do not see anything like this for Tomcat. Luckily, my
problem only arises during deployment, so I was able to fix this by making a
change in the Axis2 source org.apache.axis2.deployment.DeploymentClassLoader
class.
Now the class loading is more like tomcat's webappX-- check the jars in the
service's lib folder first and if the class is not found there, move on to
search the parent...
I'm not sure changing the source is a feasible option for you since I
haven't looked at how much work changing other class loaders would be, nor
am I recommending a similar solution since it is far from a best-practice. I
am interested to see if there is a better way or work-around for this since
I am not that deep into Axis to know if my changes will ever affect anything
else.
Does anyone with more Axis2 experience have a solution?
-Brock
Lucente, Richard D wrote:
>
> The issue has to do with class loading order. After a serious round of
> debugging, what I found was that the tomcat classloader attempts to load
> the class then fails. The parent classloader within JBoss attempts to
> load the class then fails. Finally axis2 loads the class using the web
> service's classloader from the service.aar's lib directory. In a
> generic case, this is how things worked in my deployment.
>
> The issue I'm having is that I'm attempting to override the
> javax.xml.registry.* classes shipped with JBoss with updated interfaces
> to talk to a third party provider. My service.aar contains a lib
> directory with the custom jars inside. However, the classloading scheme
> described above causes the JBoss javax.xml.registry.* classes to always
> be found first. I never can load from my classloader. When I attempted
> to get the service classloader from the current MessageContext, I still
> got the tomcat classloader which failed and then delegated to JBoss.
> JBoss then loaded its implementation.
>
> I'm using JBoss 4.0.5.GA and Axis2-1.2.
>
> Can I change the classloading order so the service.aar's classloader
> goes first?
>
> Help!
>
>
--
View this message in context: http://www.nabble.com/classloading-question-with-axis2-and-jboss-tp16006230p22730644.html
Sent from the Axis - User mailing list archive at Nabble.com.