aspose file tools*
The moose likes JBoss/WildFly and the fly likes JBoss 4.2.3 class loading sequence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss 4.2.3 class loading sequence" Watch "JBoss 4.2.3 class loading sequence" New topic

JBoss 4.2.3 class loading sequence

Phani.Kiran Gutha

Joined: Dec 14, 2010
Posts: 14
Hi every body.
I have an application which contains same jar file's with different version... and those jar are my applicaition specific...

Like base.jar which is my applications model module jar files..
There are 3 version of it.

Like base-1.0.jar, which is the initial one,

base-2.0.jar which is later contains some files which are already there in base-1.0.jar but modified....

and last base-sp.jar which is appliaction specific jar file...

what i want to do is.... my war file contians base-sp.jar........ in web-inf/lib

this jar file should be ovverriden by base-2.0.jar and
base-2.0.jar should ovverride base-1.0.jar..

while loading the classes................

when application is running...... class loader should first look into base-spec.jar for the class if it is not found then should look into base-2.0.jar and it doesnt find it their then it should go to base-1.0.jar

Kindly any help me to achive this....

Thanks in Advance,
Ravish Mody

Joined: Mar 30, 2011
Posts: 7

HI PhaniKiran,

What you can do is that you can keep

base-sp.jar -> in your war file in [ web-inf/lib ]

base-2.0.jar -> in server lib folder in [ /jboss-as/server/<PROFILE>/lib ]

base-1.0.jar -> in JBoss lib folder in [ /jboss-as/lib ]

Now when you hit your application which is kept in the [/jboss-as/server/<PROFILE>/deploy] then the in case of WAR files the application would pick up the base-sp.jar first and if its not found any jar in WAR then it would look into [ /jboss-as/server/<PROFILE>/lib ] which has base-2.0.jar and if that too is not found then it would look into [ /jboss-as/lib ] which has base-1.0.jar this way your requirement is fulfilled.

Try this out


Ravish Mody
Come, Join Us and Experience The Magic…
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10113

Have a look at these:

[My Blog] [JavaRanch Journal]
Phani.Kiran Gutha

Joined: Dec 14, 2010
Posts: 14
Hi Ravish Mody ,

I have tried what you have said application loaded fine. but in middle am getting

As i said earlier GridTab is in 3 of the jar with their own modifications......

am unable to find the solution for it ...

Can you help me...

Phani.Kiran Gutha

Joined: Dec 14, 2010
Posts: 14
Hi Jaikiran Pai ,
I have seen into the links you have provided but...
only one question i have is what should be in place of

subject: JBoss 4.2.3 class loading sequence