Reputation: 1593
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:
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:
And the webapp is installed in the webapps directory:
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
Reputation: 2070
Did you restart Tomcat?
The conf/server.xml
is not reloaded after restart.
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).
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.
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
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>
Upvotes: 1