1
votes

I am learning how to use JSP, and servlets using Tomcat 7, and I just learned about Tomcat's web manager. I altered my tomcat-users.xml file appropriately to create a username and password. Tomcat is using port 8080, and when I use the following URL in Chrome

http://localhost:8080/manager/html

I get Tomcat's 404 "File cannot be found" message. All of the files that I should be able to open in my webapps folder (which the manager files are also located in) also return 404 errors.

The strange thing about this is that, in Eclipse, I have a project called "test-app" which I imported from a file I downloaded off one of my tutorials, and when I type in

http://localhost:8080/test-app/

the correct page is served.

I found this really strange because, if anything, I would think my own project would not work and the manager would. I'm uncertain how Tomcat knows how to access the webapps directory by default, so any explanation that also explains how this works would be excellent. I had been teaching myself using these files a month ago and all the webapps files were being correctly served, but now they are not.

On a different note, but possibly related, when I copy a .WAR file into my webapps directory and restart the Tomcat 7 server, the .WAR does not automatically unpack itself. When I was working on learning JSP a month ago and I copied a .WAR file into the webapps directory, it did correctly unpack. Is there a command I need to enter or a configuration file I need to change in order to get this to happen?

2
Addition: I have already checked my server.xml file in CATALINA_BASE/conf and it is configured correctly to unpack .WAR files. - almel
A possibility: does the user running tomcat (possibly 'tomcat') have permission to write to the webapps directory? - cmonkey

2 Answers

0
votes

When running Tomcat in Eclipse, Eclipse re-configures Tomcat and various files are read from alternative locations - including web applications. Running Tomcat from the command line will restore the behaviour you expect.

0
votes

If you running Tomcat in eclipse the server path and deploy path is in the .metadata. Double click your tomcat server on the servers view (windows >>show view>>others..>>server), under Server Locations choose radio button "Use Tomcat installation (takes control of Tomcat Installation) Hope it help..