-
Sep 22nd, 2007, 05:57 PM
#1
Error setting property values; exception is org.springframework.beans.NotWritable
Hi,
I am new to acegi and trying out a test project. I set up web.xml without any problems and created xml for Acegi also but I keep getting following error.
"Error creating bean with name 'daoAuthenticationProvider' defined in class path resource [com/cma/config/applicationContext-security.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'authenticationDao' of bean class [org.acegisecurity.providers.dao.DaoAuthenticationP rovider]: Bean property 'authenticationDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?"
I am not sure what the problem is, looked on the web for few hours and couldn't figure out. If someone can point me in the right direction I will appreciate it very much. The following is xml.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- ======================== FILTER CHAIN ======================= -->
<bean id="filterChainProxy"
class="org.acegisecurity.util.FilterChainProxy">
<property name="filterInvocationDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/**=httpSessionContextIntegrationFilter,authenticat ionProcessingFilter
</value>
</property>
</bean>
<!-- ======================== AUTHENTICATION ======================= -->
<bean id="authenticationManager"
class="org.acegisecurity.providers.ProviderManager ">
<property name="providers">
<list>
<ref local="daoAuthenticationProvider" />
</list>
</property>
</bean>
<bean id="daoAuthenticationProvider"
class="org.acegisecurity.providers.dao.DaoAuthenti cationProvider">
<property name="authenticationDao">
<ref local="memoryAuthenticationDao" />
</property>
</bean>
<bean id="memoryAuthenticationDao"
class="org.acegisecurity.userdetails.memory.InMemo ryDaoImpl">
<property name="userMap">
<value>admin=admin,ROLE_ADMIN user=user,ROLE_USER</value>
</property>
</bean>
<!-- Automatically receives AuthenticationEvent messages -->
<bean id="loggerListener"
class="org.acegisecurity.event.authentication.Logg erListener" />
<!-- The first item in the Chain: httpSessionContextIntegrationFilter -->
<bean id="httpSessionContextIntegrationFilter"
class="org.acegisecurity.context.HttpSessionContex tIntegrationFilter">
</bean>
<bean id="exceptionTranslationFilter"
class="org.acegisecurity.ui.ExceptionTranslationFi lter">
<property name="authenticationEntryPoint">
<ref local="authenticationProcessingFilterEntryPoint" />
</property>
</bean>
<bean id="authenticationProcessingFilter"
class="org.acegisecurity.ui.webapp.AuthenticationP rocessingFilter">
<property name="authenticationManager">
<ref bean="authenticationManager" />
</property>
<property name="authenticationFailureUrl">
<value>/acegilogin.jsp?login_error=1</value>
</property>
<property name="defaultTargetUrl">
<value>/secured/</value>
</property>
<property name="filterProcessesUrl">
<value>/j_acegi_security_check</value>
</property>
</bean>
<bean id="authenticationProcessingFilterEntryPoint"
class="org.acegisecurity.ui.webapp.AuthenticationP rocessingFilterEntryPoint">
<property name="loginFormUrl">
<value>/sp/login.do</value>
</property>
<property name="forceHttps">
<value>false</value>
</property>
</bean>
<bean id="roleVoter" class="org.acegisecurity.vote.RoleVoter">
<property name="rolePrefix" value="" />
</bean>
<bean id="httpRequestAccessDecisionManager"
class="org.acegisecurity.vote.AffirmativeBased">
<property name="allowIfAllAbstainDecisions">
<value>false</value>
</property>
<property name="decisionVoters">
<list>
<ref bean="roleVoter" />
</list>
</property>
</bean>
<bean id="filterInvocationInterceptor"
class="org.acegisecurity.intercept.web.FilterSecur ityInterceptor">
<property name="authenticationManager">
<ref bean="authenticationManager" />
</property>
<property name="accessDecisionManager">
<ref local="httpRequestAccessDecisionManager" />
</property>
<property name="objectDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/secured*=ROLE_ADMIN /**=ROLE_USER
</value>
</property>
</bean>
</beans>
Thank you
Srini
-
Sep 23rd, 2007, 05:08 AM
#2
If you search the web/forums, you will find this error discussed many times in relation to Spring configurations. The key here is
"Invalid property 'authenticationDao' of bean class [org.acegisecurity.providers.dao.DaoAuthenticationP rovider]"
If you look at the code or Javadoc for this class you will see that it has no 'authenticationDao' property:
http://acegisecurity.org/acegi-secur...nProvider.html
You want to use 'userDetailsService' instead.
Your filter chain configuration is also incorrect. Please start by getting the tutorial sample running and building from that as a working example.
-
Sep 23rd, 2007, 11:08 AM
#3
Tutorial
Hi Luke thanks for help. I got it working. Could you pls point me how I can find the example tutorial, I downloaded src zip for 1.0.4 but I do not see any folder called example or tutorial.
Thanks in advance.
Thank you
Srini
-
Sep 23rd, 2007, 05:02 PM
#4
If I were you I would check out the 1.0.x code tree using
svn co http://acegisecurity.svn.sourceforge.../1.0.x-branch/
(assuming you have subversion command line client installed, otherwise do it through an IDE or other subversion client).
Then follow the description on the web site:
http://acegisecurity.org/building.html
which explains how to run the contacts sample app using the jetty plugin. You can do the same for the tutorial sample app.
There are binary versions in the release builds.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules