2021年3月10日星期三

Tomcat problems finding my java servlet file

New installation of Apache/tomcat with new webhosting company and having problems finding my Java servlet file.

Tomcat is up and running but getting error 404.

This is my server.xml file

<?xml version='1.0' encoding='utf-8'?>  <Server port="8218" shutdown="SHUTDOWN">      <Service name="Catalina">        <Connector port="8222" protocol="HTTP/1.1"                 connectionTimeout="20000" proxyPort="80" address="127.0.0.1" maxPostSize="67589953" />        <Connector port="8223" protocol="HTTP/1.1" scheme="https" secure="true"                 connectionTimeout="20000" proxyPort="443" address="127.0.0.1" maxPostSize="67589953"/>        <Engine name="Catalina" defaultHost="<MY-DOMAIN>">          <Host name="<MY-DOMAIN>" appBase="webapps2">            <Context path="/<URL-PREFIX>" docBase="<PATH-TO-JAVA-SERVLETS>" reloadable="true" crossContext="true">          </Context>       </Host>        </Engine>    </Service>  </Server>  

I'm trying to access a servlet via url pattern below

http://<MY-DOMAIN>/<URL-PREFIX>/servlet_name

servlet_name.class file is in <PATH_TO_JAVA_SERVLETS>/WEB-INF/classes folder

I've verified the existence of the file.

The 404 error is from Tomcat - so it's up and running and handling the request (i think) but not finding the class file. If I enter http://<MY-DOMAIN>/XXX/YYY - the error is from Apache.

Where in Apache (I assume) do I configure so that the above url request is fulfilled.

Thank you.

https://stackoverflow.com/questions/66568913/tomcat-problems-finding-my-java-servlet-file March 11, 2021 at 12:26AM

没有评论:

发表评论