2013-09-23 110 views
0

我有一些奇怪的行为与弹簧安全。异常开始过滤器springSecurityFilterChain java.lang.NoClassDefFoundError

当我加载应用程序我得到一个异常

SEVERE: Exception starting filter 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> 

感谢

+1

看看http://stackoverflow.com/questions/13168215/propertytypedescriptor-and-spring-3-1-2 –

+0

对于初学者来说,你在混合使用Spring Security版本(3.1.0和3.1.4)从不混合不同版本的框架。修复这个问题,同时确保你不要使用混合版本的Spring jar(检查'mvn dependency:tree'),如果这样的话明确定义你想要使用的版本。 –

回答

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.RELEASEpom状态。

因此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: Update Spring Version to 3.2.4.RELEASE 23 days ago"

0

EnvironmentAware位于弹簧上下文3.1.1.RELEASE.jar一看评论,所以你丢失的那一个。

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

相关问题