File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jar Isolation Not Working

 
graham king
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
graham king
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it due to the packaging or is this a bug in JBoss?
 
Poornima Shankar
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a class loader, holding the pointer to the stale code it seams..and this bug has been fixed in JBOSS4 i believe..
 
graham king
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic