gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 14:05:09 25 4
gpt4 key购买 nike

我在使用 Spring Security 时遇到了一些奇怪的行为。

当我加载应用程序时,出现异常

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>

谢谢

最佳答案

根据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 到 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"

关于java - 启动过滤器 springSecurityFilterChain java.lang.NoClassDefFoundError 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18959673/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com