Reputation: 67
<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-4.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
<security:http access-denied-page="/jsp/403.jsp">
<security:form-login login-page="/login/reDirect.jsp"
authentication-failure-url="/login/reDirect.jsp?error=true"
default-target-url="/jsp/main.jsp" />
<security:anonymous />
<security:http-basic />
<security:logout logout-url="/logout.action"
logout-success-url="/login/login.jsp" />
</security:http>
I got this error, while upgrating spring 2.5.6 to 4.0.4:
Exception sending context initialized event to listener instance of class org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:com/essar/mes/hpl/config/spring-security.xml] Offending resource: class path resource [com/essar/mes/hpl/config/spring-config.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [com/essar/mes/hpl/config/spring-security.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.support.BeanDefinitionBuilder.setSource(Ljava/lang/Object;)Lorg/springframework/beans/factory/support/BeanDefinitionBuilder;
This indicates thats there is no method in setSource in springDefinationBuilder in Spring 4.0.X-beans
Is there any alternative to solve this?
Upvotes: 1
Views: 1185
Reputation: 52368
You need at least Spring Security 3.0.0 for Spring 4, or you need an older Spring 3.2.x version for Spring Security 2.0.x. That method has been marked as deprecated starting with Spring 2.5 and removed completely in Spring 4.
Upvotes: -1