ulrich
ulrich

Reputation: 1593

Tomcat 9 does not find deployed webapp

I installed tomcat 9.0.40 on Windows 10 and deploy to it from Eclipse. The tomcat always responds with 404, even with all modifications I had introduced that I found in other posts.

Here is my current setup:

Eclipse server config, pointing to the configuration in Eclipse, using the tomcat installation path and deploying to webapps directory:

Eclipse Server config

The server.xml from the Eclipse Server config uses port 8087, the webapps directory and shows the deployed context:

<Connector connectionTimeout="20000" port="8087" protocol="HTTP/1.1" redirectPort="8443"/>
...
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
...
<Context docBase="projects-topics-ws" path="/projects-topics-ws" reloadable="true" source="org.eclipse.jst.jee.server:projects-topics-ws"/></Host>

My Eclipse Server view shows the deployed webapp:

Webapp in Eclipse Server view

And the webapp is installed in the webapps directory:

Deployed webapp

In the Eclipse Project Facets I have checked "Dynamic Web Module 4.0" and "JAX-RS Webservice 2.1" but that doesn't seem to help either.

I can access the tomcat manager application at http://localhost:8087/manager/html and it shows my application as deployed and running.

Nevertheless, the tomcat responds with 404 if I access the application at the application base path http://localhost:8087/projects-topics-ws/, where it should respond with XML content.

Any ideas what I am missing?

Upvotes: 0

Views: 3104

Answers (1)

supernova
supernova

Reputation: 2070

  1. Did you restart Tomcat? The conf/server.xml is not reloaded after restart.

  2. cite: 'The server.xml from the Eclipse Server': Check if the file is really evaluated ok (e.g. change port and restart server if you're not sure).

  3. Your appBase is relative to $CATALINA_BASE directory, so you might want to double check that. It looks like it should be ok as the manager webapp seems working ok from same dir but I know some people having multiple servers installed in parallel and getting mislead by this.

  4. Did you just check the base URL or also a specific (optimally static) resource from http://localhost:8087/projects-topics-ws/? e.g. http://localhost:8087/projects-topics-ws/html/index.html

  5. Do you have a welcome page defined? If calling the base url, Tomcat will look for such file if defined:

<welcome-file-list>
<welcome-file>
   index.html
</welcome-file>
</welcome-file-list>
  1. Did you use the URL in browser or did you click on the path in the Tomcat management console, where it shows your deployed application? Is the path in the browser the same?

Upvotes: 1

Related Questions