我在Apache Tomcat服务器(8.5.23)上的rest.war中部署了Spring Boot Rest API应用程序的问题。复制步骤:
启动tomcat
正常工作(localhost:8080 / test / method 200 OK)
关闭tomcat
启动tomcat
工作不正确(localhost:8080 / test / method 404 NOT FOUND)
关闭tomcat
再次正常工作
启动时日志的差异:
正确:
o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4b32c94c: startup date [Tue Oct 17 12:55:48 CEST 2017]; root of context hierarchy
Mapped "{[/profile/{profileId}/find/{page}],methods=[POST]}" onto public someone.model.responses.ProfilesLiteResponse someone.backend.MainController.find(java.lang.Long,java.lang.Integer,someone.model.ProfileLiteQuery)
Mapped "{[/test/{id}],methods=[GET]}" onto public someone.model.Location someone.backend.MainController.test(java.lang.String)
Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
不正确:
o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
完整日志:
https://paste.ofcode.org/n6ZhPysDzXYCkSDBPv2jDm
https://paste.ofcode.org/fxquvJDjV73fuv6rfxRRkY
任何人都可以解释为什么在解压缩.war后不会触发映射?任何想法赞赏!干杯,Jacek
答案 0 :(得分:-1)
好的,问题已修复 - 双重依赖性存在问题