PDA

View Full Version : NotWritablePropertyException: Invalid property 'uRL' of bean



zorak
Jul 26th, 2005, 05:21 AM
hello all,

i'm trying to integrate acegisecurity with an ldap server.

I put the following in my app-security.xml: (more or less a plain copy from the javadocs)


<bean
id="authenticationProvider"
class="net.sf.acegisecurity.providers.dao.PasswordDaoAuth enticationProvider">
<property name="passwordAuthenticationDao">
<ref local="ldapDaoImpl" />
</property>
</bean>

<bean
id="ldapDaoImpl"
class="net.sf.acegisecurity.providers.dao.ldap.LdapPasswo rdAuthenticationDao">
<property name="uRL">
<value>ldap&#58;//localhost&#58;389/</value>
</property>
<property name="rootContext">
<value>dc=mycompany,dc=com</value>
</property>
<property name="userContext">
<value>cn=&#123;0&#125;,ou=Users,dc=mycompany,dc=com</value>
</property>
<property name="userRolesAttribute">
<value>memberOf</value>
</property>
</bean>


when i start tomcat i get


2005-07-26 12:17:55,590 ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'authenticationProvider' defined in ServletContext resource [/WEB-INF/mvcskel-security.xml]: Can't resolve reference to bean 'ldapDaoImpl' while setting property 'passwordAuthenticationDao'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'ldapDaoImpl' defined in ServletContext resource [/WEB-INF/mvcskel-security.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'uRL' of bean class [net.sf.acegisecurity.providers.dao.ldap.LdapPasswo rdAuthenticationDao]: Bean property 'uRL' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'ldapDaoImpl' defined in ServletContext resource [/WEB-INF/mvcskel-security.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'uRL' of bean class [net.sf.acegisecurity.providers.dao.ldap.LdapPasswo rdAuthenticationDao]: Bean property 'uRL' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'uRL' of bean class [net.sf.acegisecurity.providers.dao.ldap.LdapPasswo rdAuthenticationDao]: Bean property 'uRL' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:814)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:734)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:862)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:889)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:878)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:930)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:731)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:340)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:176)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:105)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:920)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:731)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:340)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:276)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:312)
at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:134)
at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:230)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:156)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 48)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4343)
at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.addC hild(StandardHostDeployer.java:903)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.commons.beanutils.MethodUtils.invokeMet hod(MethodUtils.java:216)
at org.apache.commons.digester.SetNextRule.end(SetNex tRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276 )
at org.apache.commons.digester.Digester.endElement(Di gester.java:1058)
at org.apache.catalina.util.CatalinaDigester.endEleme nt(CatalinaDigester.java:76)
at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
at org.apache.commons.digester.Digester.parse(Digeste r.java:1567)
at org.apache.catalina.core.StandardHostDeployer.inst all(StandardHostDeployer.java:488)
at org.apache.catalina.core.StandardHost.install(Stan dardHost.java:863)
at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:483)
at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:789)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:478)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:480)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:425)
StandardContext[/SpringMVCSkel]Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'authenticationProvider' defined in ServletContext resource [/WEB-INF/mvcskel-security.xml]: Can't resolve reference to bean 'ldapDaoImpl' while setting property 'passwordAuthenticationDao'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'ldapDaoImpl' defined in ServletContext resource [/WEB-INF/mvcskel-security.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'uRL' of bean class [net.sf.acegisecurity.providers.dao.ldap.LdapPasswo rdAuthenticationDao]: Bean property 'uRL' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'ldapDaoImpl' defined in ServletContext resource [/WEB-INF/mvcskel-security.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'uRL' of bean class [net.sf.acegisecurity.providers.dao.ldap.LdapPasswo rdAuthenticationDao]: Bean property 'uRL' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'uRL' of bean class [net.sf.acegisecurity.providers.dao.ldap.LdapPasswo rdAuthenticationDao]: Bean property 'uRL' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:814)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:734)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:862)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:889)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:878)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:930)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:731)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:340)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:176)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:105)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:920)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:731)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:340)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:276)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:312)
at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:134)
at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:230)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:156)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 48)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4343)
at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.addC hild(StandardHostDeployer.java:903)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.commons.beanutils.MethodUtils.invokeMet hod(MethodUtils.java:216)
at org.apache.commons.digester.SetNextRule.end(SetNex tRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276 )
at org.apache.commons.digester.Digester.endElement(Di gester.java:1058)
at org.apache.catalina.util.CatalinaDigester.endEleme nt(CatalinaDigester.java:76)
at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
at org.apache.commons.digester.Digester.parse(Digeste r.java:1567)
at org.apache.catalina.core.StandardHostDeployer.inst all(StandardHostDeployer.java:488)
at org.apache.catalina.core.StandardHost.install(Stan dardHost.java:863)
at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:483)
at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:789)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:478)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:480)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:425)


i'm using the lates version (acegisecurity-2005-07-25_070007) from the sandbox. i'm sure i'm missing something here. but what is it?

Andreas Senft
Jul 26th, 2005, 09:23 AM
Note the JavaBeans naming conventions. If a property name starts with more than one uppercase letter, the first one will not be taken lowercase.
So the correct property name in this case is URL (all uppercase).

Regards,
Andreas

zorak
Jul 26th, 2005, 09:47 AM
you are right. working great now.

thank you