我試圖在Tomcat 7上運行Spring Boot應用程序。從我的理解來看,它應該與servlet 3.0規範兼容。Spring Boot Servlet API Version
在我的依賴,我標誌着Tomcat作爲提供:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope> <!-- Mark as provided so it doesn't interfere when we deploy in container -->
</dependency>
編輯:我已經添加了財產<tomcat.version>7.0.59</tomcat.version>
但我仍然無法啓動tomcat吧。我得到這個錯誤:
Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
at org.apache.tomcat.websocket.server.WsServerContainer.(WsServerContainer.java:147)
at org.apache.tomcat.websocket.server.WsSci.init(WsSci.java:131)
at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:47)
這是因爲它顯然需要servlet規範3.1。
我錯過了什麼嗎?