File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Jar Isolation Not Working" Watch "Jar Isolation Not Working" New topic

Jar Isolation Not Working

graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133

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

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:
subject: Jar Isolation Not Working
It's not a secret anymore!