Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

different class-loading mechanism for the same application - possible?

 
Guy Roth
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running my application on JBoss server 4.2.3.GA and use JBoss cache 3.1 as part of the application deployment.
It seems that the jar to support JBoss cahce that are part of my WEB-INF/lib are in conflict with the jar of JBoss AS

I looked at this article that discusses JBoss class-loading and my question is:

Is it possible to isolate only selected packages from my application so that the will load utility classes first from server/default/lib while the rest of the classes from my application will use same utility classes but look for them first from the application's archive?
So I could use different version of the same utility classes in the same application?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guy Roth wrote:

Is it possible to isolate only selected packages from my application so that the will load utility classes first from server/default/lib while the rest of the classes from my application will use same utility classes but look for them first from the application's archive?
So I could use different version of the same utility classes in the same application?


Are you saying that you have a jar XYZ.jar and you want some classes to be loaded from this jar and some other classes (which are present in XYZ.jar) to be loaded from some other jar (from server/default/lib)?
 
Guy Roth
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Let me try to provide an example:

let's say that the class Util that contain the metho foo() exist both in WEB-INF/lib and in server/default/lib (but in different versions)
I want to be able that if I perform from my web-application a call from package:
com.x.Aclass
Util.foo()
it will use the Util from WEB-INF/lib
and if I perform a call from
com.y.Bclass
Utill.foo() it will use the Util from server/default/lib

Is this possible in JBoss 4.3.2 or in JBoss 5.1?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic