*
The moose likes JBoss/WildFly and the fly likes JBoss 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 "JBoss class loader" Watch "JBoss class loader" New topic
Author

JBoss class loader

Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Hi,

I am working on JBoss 5.0.0 GA. I have an .ear file which contains few libraries(.jar files) at the root level in the ear.

I was under the impression that all the libraries(.jar files) at the root level of ear are in the classpath by default but i get class not found exceptions while deploying the ear. However If, i add the jar file to the application.xml then it works fine.

Is this the intended behaviour? Shouldn't JBoss add the libraries to classpath by default?

Thanks,
Srikanth.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Yes, this is the intended behavior. Only JAR files in the lib directory within the EAR file are automatically added to the classpath.


JBoss In Action
Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Originally posted by Peter Johnson:
Yes, this is the intended behavior. Only JAR files in the lib directory within the EAR file are automatically added to the classpath.


Peter,

This question might be silly but want some clarification from you.
I have few .properties files at the root level of ear and JBoss picks all the files which means they are in the classpath by default then why doesn't it pick the jar files? Is it how the JBoss is designed?

Thanks,
Srikanth.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Yes, it is strange but true. But recall that if you place a directory in your classpath that the JVM does not pick up the JAR files located in that directory - you have to add the JAR files specifically. (Rumor has it that this will be "fixed" in JDK 7...)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss class loader