【问题标题】:java.lang.NoClassDefFoundError: : org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator with Spring Securityjava.lang.NoClassDefFoundError: : org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator with Spring Security
【发布时间】:2015-08-01 21:39:01
【问题描述】:

如果我已经有了 aop 库,我只是不明白为什么会出现这个错误。

我的 spring-security-context.xml,我崩溃的地方看起来像:

 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:security="http://www.springframework.org/schema/security"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans.xsd
   http://www.springframework.org/schema/security
   http://www.springframework.org/schema/security/spring-security.xsd">

<security:http>
    <security:intercept-url pattern="/*" access="ROLE_USER" />
    <security:http-basic />
</security:http>

<security:authentication-manager>
    <security:authentication-provider>
        <security:user-service>
            <security:user name="user" password="123456" authorities="ROLE_USER" />
        </security:user-service>
    </security:authentication-provider>
</security:authentication-manager>

由于问题的代码限制,我无法添加我的 pom.xml,但它有:

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-web</artifactId> 
    <version>4.0.1.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-config</artifactId>
    <version>4.0.1.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>4.1.6.RELEASE</version>
</dependency>

【问题讨论】:

  • 由于问题的代码限制,我无法添加我的 pom.xml,但它有:` org.springframework.securityspring-security -web4.0.1.RELEASEorg.springframework.securityspring-security-config4.0.1.RELEASE `
  • org.springframeworkspring-aop4.1.6.RELEASE
  • 发布完整的依赖关系,从这里判断你正在混合来自 Spring 的不同版本的 jar。

标签: spring maven spring-security


【解决方案1】:

找到了解决方案here

似乎是 Spring Security 本身带来了错误的(旧的)依赖关系。

我找到的解决方案完全解决了这个问题。

【讨论】:

    猜你喜欢
    • 2015-10-14
    • 2014-06-29
    • 2020-08-09
    • 1970-01-01
    • 1970-01-01
    • 2018-04-15
    • 1970-01-01
    • 1970-01-01
    • 2013-04-06
    相关资源
    最近更新 更多