• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with EAR holding WAR and JAR files

 
Tiago Fernandez
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Dave Salter
Ranch Hand
Posts: 293
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic