This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes different class-loading mechanism for the same application - possible? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "different class-loading mechanism for the same application - possible?" Watch "different class-loading mechanism for the same application - possible?" New topic
Author

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

Guy Roth
Ranch Hand

Joined: Aug 09, 2009
Posts: 74
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

Joined: Jul 20, 2005
Posts: 10146
    
165

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)?


[My Blog] [JavaRanch Journal]
Guy Roth
Ranch Hand

Joined: Aug 09, 2009
Posts: 74
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?
 
GeeCON Prague 2014
 
subject: different class-loading mechanism for the same application - possible?