I am somewhat new to spring security and I am trying to migrate an existing application from security 2.0.4 to 3.1 and I am getting the following error message:
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.security.authentication.dao.D aoAuthenticationProvider#0': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedEx ception: Failed to convert property value of type 'org.springframework.security.authentication.dao.D aoAuthenticationProvider' to required type 'org.springframework.security.core.userdetails.Use rDetailsService' for property 'userDetailsService'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.security.authentication.dao.Da oAuthenticationProvider] to required type [org.springframework.security.core.userdetails.User DetailsService] for property 'userDetailsService': no matching editors or conversion strategy found
I feel like I am missing something obvious but I can't for the life of me see it.
This is my applicationContextSecurity.xml file
Any help would be greatly appreciated.Code:<?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd"> <beans:bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider"> <beans:property name="userDetailsService" ref="employeeServiceFacade"/> <beans:property name="passwordEncoder" ref="passwordEncoderDecoder"/> <beans:property name="hideUserNotFoundExceptions" value="false" /> </beans:bean> <authentication-manager alias="authenticationManager"> <authentication-provider user-service-ref="daoAuthenticationProvider"/> </authentication-manager> <global-method-security secured-annotations="disabled"/> <beans:bean id="customAuthenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"> <beans:property name="loginFormUrl" value="/login.action"/> </beans:bean> <beans:bean id="customAuthenticationProcessingFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"> <beans:property name="authenticationFailureHandler" ref="failureHandler" /> <beans:property name="authenticationSuccessHandler" ref="successHandler" /> <beans:property name="authenticationManager" ref="authenticationManager"/> <beans:property name="allowSessionCreation" value="true" /> <beans:property name="sessionAuthenticationStrategy" ref="sas"/> </beans:bean> <beans:bean id="successHandler" class="com.es.tms.web.security.RoleBasedTargetUrlResolver" > <beans:property name="defaultTargetUrl" value="/timesheet/searchTimeEntries.action" /> <!-- which is the default value --> <beans:property name="roleNameToUrlMap"> <util:map> <beans:entry key="ROLE_ASSISTANT" value="/billing/viewBillings.action"/> <beans:entry key="ROLE_BILLING" value="/expenses/viewToAPApproveExpenses.action"/> <beans:entry key="ROLE_PAYROLL" value="/payroll/viewPayroll.action"/> <beans:entry key="ROLE_OFFICEASSISTANTEXPENSES" value="/expenses/searchExpenseEntries.action"/> <beans:entry key="ROLE_ADMIN_LEVEL1" value="/administration/searchEmployees.action"/> <beans:entry key="ROLE_ADMIN" value="/administration/searchEmployees.action"/> <beans:entry key="ROLE_ADMIN_ASSISTANT" value="/administration/searchEmployees.action"/> <beans:entry key="ROLE_ACCOUNT_MANAGER" value="/administration/searchEmployees.action"/> <beans:entry key="ROLE_HR" value="/administration/searchEmployees.action"/> <beans:entry key="ROLE_RECRUITER_MANAGER" value="/administration/searchEmployees.action"/> </util:map> </beans:property> <beans:constructor-arg ref="defaultTargetUrlResolver" /> </beans:bean> <beans:bean id="defaultTargetUrlResolver" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler" /> <beans:bean id="failureHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler" > <beans:property name="defaultFailureUrl" value="/login.action?login_error=true" /> </beans:bean> <beans:bean id="sas" class="org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy"> <beans:property name="migrateSessionAttributes" value="true" /> </beans:bean> <!-- Non Secured patterns --> <http security="none" pattern="/images/**" /> <http security="none" pattern="/styles/**" /> <http security="none" pattern="/scripts/**" /> <http security="none" pattern="/common/**" /> <http auto-config="false" entry-point-ref="customAuthenticationEntryPoint" access-denied-page="/forbidden.jsp"> <custom-filter position="FORM_LOGIN_FILTER" ref="customAuthenticationProcessingFilter" /> <!-- SECURITY URLs --> <intercept-url pattern="/login.action*" access="IS_AUTHENTICATED_ANONYMOUSLY" /> <intercept-url pattern="/index.jsp*" access="IS_AUTHENTICATED_ANONYMOUSLY" /> <intercept-url pattern="/error*" access="IS_AUTHENTICATED_ANONYMOUSLY" /> <logout logout-success-url="/login.action"/> <anonymous username="Guest" granted-authority="ROLE_ANONYMOUS"/> <remember-me/> </http> <authentication-manager> <authentication-provider user-service-ref="employeeServiceFacade"> <password-encoder ref="passwordEncoderDecoder"/> </authentication-provider> </authentication-manager> <beans:bean id="passwordEncoderDecoder" class="com.es.tms.util.CustomPasswordEncoder"/> <beans:bean id="employeeServiceFacade" class="com.es.tms.service.security.EmployeeServiceFacade"> <beans:property name="coreService" ref="coreService"/> <beans:property name="hireStatusCodes" value="O:SOP's have not been completed#P:Survey has not been completed" /> </beans:bean> </beans:beans>
Thanks,
Steve


Reply With Quote
