aspose file tools*
The moose likes JBoss/WildFly and the fly likes Problem with EAR holding WAR and JAR files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Problem with EAR holding WAR and JAR files" Watch "Problem with EAR holding WAR and JAR files" New topic
Author

Problem with EAR holding WAR and JAR files

Tiago Fernandez
Ranch Hand

Joined: May 16, 2003
Posts: 167
Hi there!

I'm generating a .ear file using Maven and deploying at JBoss 4.0.3RC1. This file contains all .jar and .war files needed for my application, and for now I basically have to access one of the web-applications (defined at security.war, inside security.ear) located at http://localhost:8080/security. It works, I can access the published site at the "security" context, but it doesn't work when I try to access the HttpInvoker Spring's service for example (I'm getting rid of EJB).

So, the problem seems ridiculous: apparently the web-app can't find other resources like spring.jar's classes, and so on. I'm getting a lot of ClassNotFoundException. I don't know what's wrong with this, it works when I get rid of the .ear and copy all libraries in /lib directory, but of course I did that just for testing.

Can anybody help me?

Thanks in advance,


Tiago Fernandez
http://www.tiago182.spyw.com/
Dave Salter
Ranch Hand

Joined: Jul 20, 2005
Posts: 293

Do you have all the spring Jars in your web-inf/lib directory?

If you are going to use Spring in a few projects/jars, then why not put the Spring jars inside the server/default/lib directory (assuming you are using the default distribution)?
Tiago Fernandez
Ranch Hand

Joined: May 16, 2003
Posts: 167
Hi Dave, I appreciate your reply.

So, before posting I thought putting the libs inside /WEB-INF/lib, but it would duplicate all all jars needed for both EAR and WAR. I just figured it out how to do it: since I'm using Maven for producing the EAR file, the problem was I was forgetting to add the needed libraries as classpath in /META-INF/MANIFEST.MF, setting the property <war.manifest.classpath>true</war.manifest.classpath> for each dependecy at project.xml

That's it!

[ July 31, 2005: Message edited by: Tiago Fernandez ]
[ July 31, 2005: Message edited by: Tiago Fernandez ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with EAR holding WAR and JAR files