This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Jar Isolation Not Working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Jar Isolation Not Working" Watch "Jar Isolation Not Working" New topic
Author

Jar Isolation Not Working

graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
All,

I've been up and down this road many times, but, I've finally come to the conclusion that the Jar Isolation mechanism posted in the documents does not work. Here's why:

I've flipped the flag UseJbossWebLoader found in server\default\deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml to read:




I have two apps which require three of the same jar files. If both apps exist in the deploy directory at the same time and JBoss is restarted I get an array of LinkageError's and ClassCastException errors.

However, if one single app containing the three redundant jar files is deployed alone. And if that app is navigated completly through. Then if the next app is deployed the applications work.

This just leads me to believe that the isolation isn't handled correctly and that app2 is actually using classes from the app1 deployment.

What do you think?


write, revise, re-write, revise, again...<br />write, revise, re-write, revise, again...
graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
Is it due to the packaging or is this a bug in JBoss?
Poornima Shankar
Greenhorn

Joined: Jul 21, 2005
Posts: 28
This is a class loader, holding the pointer to the stale code it seams..and this bug has been fixed in JBOSS4 i believe..


"Advice: wise dont want it, Fools never get it"
graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
As it turns out the easiest way to fix this is to add an entry into the jboss-app.xml file, found: myapp.ear/meta-inf/jboss-app.xml

The entry definies an isolated class loader for the ear through a unique namespace. My entry looks like the following:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jar Isolation Not Working
 
Similar Threads
EJB unable to access class under war's WEB-INF/classes (ear deployment)
JBoss' embedded tomcat not Logging
Problem starting JBOSS 4.2.3
Jboss class loader isolation problem with spring
deploying two identical webapps independently