[jboss-user] [Management, JMX/JBoss] - Re: Class loader probelm

xaleyba do-not-reply at jboss.com
Thu Mar 15 07:23:34 EDT 2007

"azhurakousky" wrote : If you are using the same Spring versions, then your runtime of bothe WAR and SAR should use classes loaded by the same class loader, to avoid problems. There are several things you can do. 
  | 1) The obvious one is to do what you don't want to do (why?) and that is to copy Spring JARs in the lib directory of JBoss. This way WAR and SAR will be using classes loaded by the same class loader.
  | 2) Since you don't want to copy to lib dir, and if I understand correctly your SAR and WAR have some type of reliance on one another, you can encapsulate your WAR inside of SAR.
  | 3) You can also enable JBoss Class Loading model for the WAR. By default it is desabled and that is why you are having problems whenever you are dealing with the same classes (WAR/SAR). You probably getting ClassCast/Linkage and other errors simply becouse those classes are loaded by different class loaders. To do that:
  | a) Remove your loader isolation for the SAR
  | b) Go to JBOSS_HOME/server/<your_configuration>/deploy/jbossweb-tomcat55.sar\META-INF\jboss-service.xml and change the following attribute to "true"
  |   | <attribute name="UseJBossWebLoader">true</attribute>
  |   | 
  | Let me know

Thanks for your reply.

I don't want to have my spring jars in the main jboss server instance lib directory because there are many other applications (made by other people) and I found this mix terrible. Anybody could install another app with another spring version that can generate problems to my app or viceversa. 

I found more clean to have my app´s isolated with their dependencies (except for those jar that come with JBoss by defualt.

I can't use option 2 because tomcat service is used by other apps´.

I'll try option 3 but I guess it will problematic too because same reasons that explain above.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028318#4028318

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028318

More information about the jboss-user mailing list