*
The moose likes IDEs, Version Control and other tools and the fly likes HTTP Status 404. My project runs ok w/ eclipse +tomcat; fails when exporting to .war Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "HTTP Status 404. My project runs ok w/ eclipse +tomcat; fails when exporting to .war" Watch "HTTP Status 404. My project runs ok w/ eclipse +tomcat; fails when exporting to .war" New topic
Author

HTTP Status 404. My project runs ok w/ eclipse +tomcat; fails when exporting to .war

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Hi all,

My struts development on eclipse works just fine. I can view my application on the browser (localhost) and it works just as I'm expecting it to work. This holds on the development phase.

Now, I need to show my result to a client. I'm exporting the project into a war file (right click the project --> export --> war file) and I upload the war file on my tomcat (I mean I don't use eclipse, I use the tomcat application)


So I do this,
0. I have the .war file
1. I shutdown the server from eclipse (consider shutdown eclipse)
2. I place the war file under webapps
3. I startup tomact
4. I verify that tomcat is up and running (it is!)
5. I go to my project: http://localhost:8080/Troopers
6. I see that under webapps the war file was extracted to a folder (Troopers)

and this is what I get:

HTTP Status 404 - /Troopers/
--------------------------------------------------------------------------------

type Status report

message /Troopers/

description The requested resource (/Troopers/) is not available.



can anyone advise why?

* I'm using eclipse 3.3.1.1
* Tomcat v5.5

Thank you!
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

Could you please go to Tomcat manager and check if the Running property for your project is True.

If it is false, then there was some error in deployment.
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Thank you Anubhav,

could you explain what is the Tomcat manager? do you refer to the Tomcat with eclipse (the plugin)?

I did this:
on the project-->right click-->properties-->Tomcat

General- [x] Is a Tomcat Project

still...same issue.

thanks again!
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

Tomcat Manager is the web console of the Tomcat web server. When you normally say http://localhost:8080 then you get the Tomcat Homepage.
Now there are a few links on the top left side and one of them is the "Tomcat Manager".
Tomcat Manager is the page where you can see the list of applications deployed on your server and other essential properties for them.

One of the properties is "Running". It is depicted as a column on the Tomcat manager page.
What I meant was if the running property for your application is false then there was some error in deployment and tocat is not able to start your application.

The error can be because of many reasons like.
- Error in war file
- Error in deployment descriptor
- Error in tomcat application loader
or, multiple other reasons.

So, on the first case I suggest that you check the running property and see if it is false ( which I think must be the case). Then, just clean your project-recompile and make a fresh war and try to deploy it.


And just one more thing, if your project was made with eclipse on some other machine and you copied your project to another machine and deployed it, that can also lead to some issues as the .project file for eclipse IDE stores some information for the native machine and this may lead to clashes when you try to deploy the code on Tomcat.

Hope that helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 404. My project runs ok w/ eclipse +tomcat; fails when exporting to .war
 
Similar Threads
no connection to localhost possible
Deploying .war file in tomcat
Advice on deploying WAR file
Tomcat Doubts
How does Tomcat 6 know to automatically redeploy an application?