java - How to force jboss to load classes from jars in webapp's lib -


i trying deploy web application on jboss-6.0.0final, deployed on apache tomcat. have 2 jars 1 contains same package org.apache.axis. putting 1 jar in <jboss-home>/server/default/lib & jar in <my-app-war>web-inf/lib.

it required put both jars in class path. no way remove 1 of jar. need keep both jars. & giving me following error

java.lang.classcastexception: org.apache.axis.attachments.attachmentsimpl cannot cast org.apache.axis.attachments.attachments     @ org.apache.axis.axisfault.makefault(axisfault.java:101)     @ org.apache.axis.client.call.invoke(call.java:1828) 

i think due conflict of same classes in 2 different jars.

now, want know way can force jboss load classes of particular package axis.jar exist in /web-inf/lib.

how can that?

i'll share quite simple , straight forward process had followed when came across same situation.

1> create jboss-web.xml file.

  <class-loading java2classloadingcompliance="false">   <loader-repository>       com.rts:archive=dth_prod.war       <loader-repository-config>           java2parentdelegation=false       </loader-repository-config>   </loader-repository>   </class-loading> </jboss-web> 

points:,

  • begin xml tag not visible in code i'm posting check 3rd line of above code,
  • com.rts - package name.
  • dth_prod.war - name of bundle wish keep

2> place xml file web-inf directory of project , voilla!!

further more may wish refer this article detailed info. comment below if face difficulty solving this.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -