无法在tomcat Docker中运行Spring Mvc教程示例

通过Spring教程 ,我已经下载了完整的代码 。 并对pom.xml文件进行了以下更改:

<packaging>war</packaging> 

运行mvn package我创build了gs-rest-service-0.1.0.war文件。

然后,我下载了Tomcat docker tomcat:8.0并为tomcat用户启用了manager-gui ,这样我就可以使用网页pipe理器。 login到Web界面,我将生成的.war包文件部署到Tomcat服务器中。 一旦开始,我浏览到http://localhost:8080/gs-rest-service-0.1.0/greeting并面对:

 HTTP Status 404 - /gs-rest-service-0.1.0/greeting type Status report message /gs-rest-service-0.1.0/greeting description The requested resource is not available. Apache Tomcat/8.0.32 

启用tomcat的日志,它不会输出任何错误,只是:

 09-Mar-2016 19:04:31.746 FINE [http-nio-8080-exec-61] org.apache.catalina.connector.CoyoteAdapter.parsePathParameters The variable [uriBC] has value [/gs-rest-service-0.1.0/greeting] 09-Mar-2016 19:04:31.746 FINE [http-nio-8080-exec-61] org.apache.catalina.connector.CoyoteAdapter.parsePathParameters The variable [semicolon] has value [-1] 09-Mar-2016 19:04:31.747 FINE [http-nio-8080-exec-61] org.apache.catalina.connector.CoyoteAdapter.parsePathParameters The variable [enc] has value [utf-8] 09-Mar-2016 19:04:31.747 FINE [http-nio-8080-exec-61] org.apache.catalina.realm.RealmBase.findSecurityConstraints No applicable constraints defined 09-Mar-2016 19:04:31.764 FINE [http-nio-8080-exec-62] org.apache.catalina.connector.CoyoteAdapter.parsePathParameters The variable [uriBC] has value [/favicon.ico] 09-Mar-2016 19:04:31.765 FINE [http-nio-8080-exec-62] org.apache.catalina.connector.CoyoteAdapter.parsePathParameters The variable [semicolon] has value [-1] 09-Mar-2016 19:04:31.765 FINE [http-nio-8080-exec-62] org.apache.catalina.connector.CoyoteAdapter.parsePathParameters The variable [enc] has value [utf-8] 

难道我做错了什么?