2016-01-07 28 views
0

我從存儲庫下載的項目無法在Apache Tomcat 7上運行。它是一個Spring 4.1.6應用程序,具有Spring security 4.0.1和OpenAM 10.0.0版本。在運行過程中對我的本地的Apache Tomcat 7實例失敗與錯誤,指出Spring Security 4無法在Tomcat上創建bean FilterChain 7

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': 
... 

嵌套的例外是

org.springframework.beans.BeanInstantiationException: Could not instantiate bean class 
[org.springframework.security.web.authentication.session.ChangeSessionIdAuthenticationStrategy]: Constructor threw exception; 
nested exception is java.lang.IllegalStateException: HttpServletRequest.changeSessionId is undefined. Are you using a Servlet 3.1+ environment? 

pom.xml文件中設置了

<filter> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 
</filter> 

<filter-mapping> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <url-pattern>/*</url-pattern> 
</filter-mapping> 

我知道這是一個構建環境配置問題,因爲源代碼已在另一臺機器上成功運行。有什麼需要改變,以獲得filterChains豆被成功

+1

'HttpServletRequest.changeSessionId是未定義的。 Tomcat 7不支持Servlet 3.1,你需要Tomcat 8。 –

回答

1

事情的關鍵創建的日誌中要注意的是:

HttpServletRequest.changeSessionId是不確定的。 您使用的是Servlet 3.1+環境嗎?

通過升級到Tomcat 8並使用Java EE 7 Web,我能夠使項目成功運行。

相關問題