I am trying to deploy my web application on jboss-6.0.0Final
, which is currently deployed on apache tomcat
.
I have two jars one that contains same package which is org.apache.axis
. I am putting one jar in <Jboss-home>/server/default/lib
& another jar in <my-app-war>WEB-INF/lib
.
It is required to put both jars in the class path. No way to remove one of the jar. So I need to keep both jars. & It is giving me following error
java.lang.ClassCastException: org.apache.axis.attachments.AttachmentsImpl cannot be cast to org.apache.axis.attachments.Attachments
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.Call.invoke(Call.java:1828)
I think it is due to conflict of same classes in two different jars.
Now, I want to know the way by which I can force jboss to load classes of this particular package from axis.jar exist in /WEB-INF/lib.
How can I do that?
I'll share quite simple and straight forward process which I had followed when I came across same situation.
1> Create a jboss-web.xml file.
Points:,
2> Now place this xml file into WEB-INF directory of your project and voilla!!
Further more you may wish to refer this article for detailed info. Also comment below if you face any difficulty solving this.
This helped me:
http://www.mastertheboss.com/jboss-configuration/solving-jboss-5-classloading-issues
Explode your war,
In your Exploded WAR web-inf directory add this xml file: jboss-classloading.xml
with content:
(domain is your war name)