wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes Class loader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Class loader" Watch "Class loader" New topic
Author

Class loader

avihai marchiano
Ranch Hand

Joined: Jan 10, 2007
Posts: 342
The server runs only single application.

JBoss 4.2 has under server\lib hibernate jars (core,annotation). I want to use in different versions so,
1.Do you recommended to replace JBoss jars with my jars or to include the new versions in my ear. I don�t like the first option because it easier to me to control with version control and with maven on the application jars.
2.in case I decide to put include them in the ear , how can I make sure that the application will use them?

Thank you
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9937
    
159

Its always recommended to package the libraries as part of your ear file. So yes, the second approach the recommended one. For more details about how to make the ear pick up these libraries, go through the following articles:

JBossClassLoadingUseCases

ClassLoadingConfiguration


[My Blog] [JavaRanch Journal]
avihai marchiano
Ranch Hand

Joined: Jan 10, 2007
Posts: 342
Thanks for your answer.

A lot of those third-parties jars are already existd in jboss server lib.

Some of them are common jars like appache common and dom4j.
Do you recommend to have those jars also in the ear and to have a bigger ear ?

Thank you
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9937
    
159

Those libraries in the JBoss lib folder are going to change whenever there is a new version of JBoss. So, if you are using those 3rd party libraries in your application then its recommended to bundle the appropriate version of those libraries in your ear. This will reduce the impact of version changes whenever you upgrade to a new version of JBoss or even whenever your application wants to upgrade to a recent version of the 3rd party library.
 
 
subject: Class loader
 
Similar Threads
Ant NoClassDefFoundError
Why do my JARs have to be in the server classpath?
Help with creating basic Session Beans (Struts + JBoss 3.2.3)
EAR deployment problem Weblogic Migration... additional resources needed on classpath
my first application its not available