带有Spring Security的java.lang.NoClassDefFoundError :: org / springframework / aop / config / AbstractInterceptorDrivenBeanDefinitionDecorator

时间:2015-05-20 14:47:08

标签: spring maven spring-security

如果我已经拥有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>

1 个答案:

答案 0 :(得分:0)

找到解决方案here

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

我发现的解决方案完全解决了这个问题。