Tomcat couldn't serve from a servlet bootstrapped by spring java configuration [duplicate]
My guess is that you miss the context path of the app which is the name of the folder inside /usr/local/tomcat/webapps/
that containing the exploded WAR . So in your case , please try :
curl -4 -v -XGET http://localhost:8080/example-05-dispatcher-servlet-code-configuration-2-1.0-SNAPSHOT/hello
If you really want to access by http://localhost:8080/hello
, you have to deploy the WAR to /usr/local/tomcat/webapps/ROOT/
. As the tomcat docker images already has a welcome page app deployed to this context , you need to delete this app first and rename your WAR to ROOT.war
, something like :
FROM tomcat
RUN rm -rvf /usr/local/tomcat/webapps/ROOT
COPY example-05-dispatcher-servlet-code-configuration-2-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/ROOT.war