Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Security-Error creating bean 'org.springframework.security.filterChains'

I am trying basic spring security set up. I am using 3.1.0.RELEASE I have in the spring security xml as follows:

<security:http auto-config='true'>
<security:intercept-url pattern="/**" access="ROLE_USER" />
</security:http>

<security:authentication-manager>
<security:authentication-provider>
<security:user-service>
<security:user name="jimi" password="jimispassword" authorities="ROLE_USER,      ROLE_ADMIN" />
<security:user name="bob" password="bobspassword" authorities="ROLE_USER" />
</security:user-service>
</security:authentication-provider>
</security:authentication-manager>

When I access the start page , I get the following exception: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.security.filterChains': Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: NULL.

Can any one help me?

like image 783
jrpalla Avatar asked Apr 18 '12 19:04

jrpalla


1 Answers

The actual cause of the problem seems to be that spring-security 3.1.0 pulls in older versions of spring which create a silent conflict. In my case spring-security-3.1.0.RELEASE pulled in spring-aop, spring-jdbc, spring-tx and spring-expression 3.0.6 but I was using spring 3.1.0.RELEASE. After adding these dependencies explicitly the problem went away.

like image 160
magiconair Avatar answered Oct 28 '22 03:10

magiconair