异常启动过滤器springSecurityFilterChain java.lang.NoClassDefFoundError

时间:2013-09-23 12:48:36

标签: java spring maven spring-security

我对弹簧安全有一些奇怪的行为。

当我加载应用程序时,我得到一个例外

  

SEVERE:异常启动过滤器springSecurityFilterChain   java.lang.NoClassDefFoundError:org / springframework / core / convert / support / PropertyTypeDescriptor

WEB.XML:

<web-app>
<display-name>Archetype Created Web Application</display-name>
 <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> 
 <servlet>
 <servlet-name>default</servlet-name>
    <servlet-class> org.apache.catalina.servlets.DefaultServlet </servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationSecurityContext.xml</param-value>
    </init-param>
   <load-on-startup>1</load-on-startup>       
</servlet>
<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>
     

的pom.xml:

      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.2.4.RELEASE</version>
    </dependency>  
      <dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>3.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.1.4.RELEASE</version>
    </dependency>

由于

2 个答案:

答案 0 :(得分:1)

根据PropertyTypeDescriptor and Spring 3.1.2,问题是从spring-core 3.1.0.RELEASE开始PropertyTypeDescriptor被移除。

spring-security-core 3.1.0.RELEASE取决于spring-core 3.0.6.RELEASE作为pom州。

因此NoClassDefFoundError。

我建议降级为spring-core to 3.0.6.RELEASE

几天前,

spring-security将依赖关系更新为spring 3.2.4.RELEASE。 看看github https://github.com/spring-projects/spring-security

中的评论
  

“SEC-2294:23天前更新Spring版本到3.2.4.RELEASE”

答案 1 :(得分:0)

EnvironmentAware位于spring-context-3.1.1.RELEASE.jar中,所以你错过了那个。

还要重新检查你的Maven POM文件,这样你就不会错过任何其他Spring库,比如spring-web,spring-webmvc(如果找到DispatcherServlet类,你可能会有这些文件),如果你使用ORM就可以使用spring-orm如果你使用JMS等,Hibernate,spring-jms

相关问题