File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse - exporting files in WAR file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse - exporting files in WAR file" Watch "Eclipse - exporting files in WAR file" New topic

Eclipse - exporting files in WAR file

Greg Soulsby

Joined: Feb 01, 2011
Posts: 9
I have my Eclipse project working nicely in dev. (actually myEclipse)

But after deploying to my ISP via a WAR file it fails as it cant find the class.

Within Eclipse I copied into /scr. Within the deployed webapp is ends up in /WEB-INF/classes, which is not in the class path.

When I copy or move to /lib then the app runs.

I put the mail.jar into /lib within Eclipse but it was not copied at all when deployed via WAR file.

So what could be happening that they are not deployed? How come a file in /scr directory ends up in /class when you deploy by WAR?

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 43377
Don’t know. Sorry. I shall move this discussion to our IDEs forum, because that appears to be an IDE-related question.
Richard Bell

Joined: Oct 20, 2011
Posts: 4

Are you using ANT to create your WAR file?
Peter Johnson

Joined: May 14, 2008
Posts: 5852

If you created a Dynamic Web Project, then you should place the mail.jar in WebContent/WEB-INF/lib

JBoss In Action
It is sorta covered in the JavaRanch Style Guide.
subject: Eclipse - exporting files in WAR file
jQuery in Action, 3rd edition