This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss 4.2.3 class loading sequence" Watch "JBoss 4.2.3 class loading sequence" New topic
Author

JBoss 4.2.3 class loading sequence

Phani.Kiran Gutha
Greenhorn

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,
PhaniKiran.Gutha
Ravish Mody
Greenhorn

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


Regards,

Ravish Mody
http://middlewaremagic.com/weblogic
Come, Join Us and Experience The Magic…
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10067
    
163

Have a look at these:

http://community.jboss.org/wiki/classloadingconfiguration
http://community.jboss.org/wiki/jbossclassloadingusecases

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

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
Greenhorn

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

com.example:archive=unique-archive-name
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss 4.2.3 class loading sequence