3

I downloaded a couple of webapps and placed them in my /webapps folder. Some of them I could open by going to http://localhost:8080/app1 and it would open. However, some others I would do the exact same thing and go to http://localhost:8080/app2 and it will display "HTTP Status 404 - /app2/", even though I am sure it is there. I've checked that it contains a WEB-INF folder just like app1, and I've even restarted Tomcat to be sure.

My question is: is there anything (perhaps in the web.xml file) that specifies what the URL has to be to start the webapp? Or is it simply just http://localhost:8080/<folder name> ?

P.S. If you want to know exactly what app1 and app2 I am refering to: app1 (works) = http://assets.devx.com/sourcecode/11237.zip app2 (doesn't work) = http://www.laliluna.de/download/eclipse-spring-jdbc-tutorial.zip

I've tried a few others as well, some work, some don't. I'm just wondering if I'm missing something.

1
  • 1
    Hum... What about logs? Some information that could help? Kind Regards Commented Sep 10, 2008 at 4:00

6 Answers 6

7

I usually debug this by going the the manager page and making sure that all of the contexts are deployed (http://localhost:8080/manager/html).

It sounds like app2 has not been deployed properly or is not starting up because of some other error.

I would look at the logs. There may be a bunch of information in there but usually it explains what is broken.

1
  • What is the username/password for this ..? Commented Nov 16, 2016 at 7:08
3

The second app (the directory named WebRoot) can also be deployed correctly but you get a 404 by going to it because there is not an "index.jsp" or "index.html" file in the root directory.

Try putting a file there with any of those names, and the 404 is gone.

A servlet mapping in the web.xml is not strictly necessary for this to work.

1
  • Thank You for that suggestion - I missed the lack of proper index file. Commented Feb 11, 2010 at 10:30
3

The first zip file you mention has a .war file as part of the zip. The second one is just the source code and it needs to be built into a .war file.

It looks like it is setup to have that done in Eclipse. Try the File>>Export option and select War file as the export type.

2

The second requires the spring framework. The only runnable things I could find were a client in eclipse-spring-jdbc-tutorial.zip\SpringJdbc\src\test\de\laliluna\library\TestClient.java and one in eclipse-spring-jdbc-tutorial.zip\SpringJdbc\src\de\laliluna\library\sample\MyApplication.java. If you open it in eclipse (it is an eclipse project), and compile, provided the Spring framework is installed, you should be able to run both.

0

Are you familiar with log4j? Spring puts a lot of often-useful information into the logs created via log4j. When I have a SpringMVC application that won't startup correctly or otherwise isn't running I check my log4j and potentially turn up the Spring log level to INFO or even DEBUG.

-1

If "/" is not accessible it means that there is no "index.html", "index.jsp" or whatever is defined in the welcome-files list of the web.xml Also no Servlet-Mapping for the context ROOT directory is present. Check the web.xml for Servlet-Mappings or try to figure out the name of the jsp/html /... file being in the context root