org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'core.CommandLineOptions': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'options' of bean class [com.fxcash.fxcore.application.impl.option.CoreCommandLineArgumentProcessorImpl]: Bean property 'options' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

Spring JIRA | David Boden | 5 years ago
  1. 0

    The org.springframework.beans.factory.config.PropertyPathFactoryBean class seems to have got more strict in 3.1.0.RELEASE. I have an object with an "options" field and a "getOptions()" method but no corresponsing "setOptions()" method. Fair enough, it isn't a bean :) However, I just wanted to log the fact that the behaviour has recently changed and maybe to help someone else out who's seeing the same error. A reasonable workaround is to switch to the MethodInvokingFactoryBean and specify "getOptions" as the method name. Unfortunatly, this isn't quite as elegant as I would hope because I have 2 levels of beans to navigate. The original spring config was: <bean id="applicationIdFromCommandLine" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"> <property name="targetObject" ref="core.commandLineProcessor" /> <property name="propertyPath" value="options.applicationId" /> </bean> Note the "options.applicationId" meaning "the applicationId property inside the options bean". I've got it working by using: <bean id="applicationIdFromCommandLine" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="targetObject"> <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="targetObject" ref="core.commandLineProcessor" /> <property name="targetMethod" value="getOptions" /> </bean> </property> <property name="targetMethod" value="getApplicationId" /> </bean> Could someone in the know please make a judgement about whether it's appropriate to relax the demand for the setter? If we want to keep it strict then fine, I'll move everything over to MethodInvokingFactoryBean. Stack trace: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'core.CommandLineOptions': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'options' of bean class [com.fxcash.fxcore.application.impl.option.CoreCommandLineArgumentProcessorImpl]: Bean property 'options' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1441) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:305) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) ... 48 more Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'options' of bean class [com.fxcash.fxcore.application.impl.option.CoreCommandLineArgumentProcessorImpl]: Bean property 'options' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:721) at org.springframework.beans.factory.config.PropertyPathFactoryBean.getObject(PropertyPathFactoryBean.java:208) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142) ... 53 more

    Spring JIRA | 5 years ago | David Boden
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'core.CommandLineOptions': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'options' of bean class [com.fxcash.fxcore.application.impl.option.CoreCommandLineArgumentProcessorImpl]: Bean property 'options' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
  2. 0

    The org.springframework.beans.factory.config.PropertyPathFactoryBean class seems to have got more strict in 3.1.0.RELEASE. I have an object with an "options" field and a "getOptions()" method but no corresponsing "setOptions()" method. Fair enough, it isn't a bean :) However, I just wanted to log the fact that the behaviour has recently changed and maybe to help someone else out who's seeing the same error. A reasonable workaround is to switch to the MethodInvokingFactoryBean and specify "getOptions" as the method name. Unfortunatly, this isn't quite as elegant as I would hope because I have 2 levels of beans to navigate. The original spring config was: <bean id="applicationIdFromCommandLine" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"> <property name="targetObject" ref="core.commandLineProcessor" /> <property name="propertyPath" value="options.applicationId" /> </bean> Note the "options.applicationId" meaning "the applicationId property inside the options bean". I've got it working by using: <bean id="applicationIdFromCommandLine" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="targetObject"> <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="targetObject" ref="core.commandLineProcessor" /> <property name="targetMethod" value="getOptions" /> </bean> </property> <property name="targetMethod" value="getApplicationId" /> </bean> Could someone in the know please make a judgement about whether it's appropriate to relax the demand for the setter? If we want to keep it strict then fine, I'll move everything over to MethodInvokingFactoryBean. Stack trace: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'core.CommandLineOptions': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'options' of bean class [com.fxcash.fxcore.application.impl.option.CoreCommandLineArgumentProcessorImpl]: Bean property 'options' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1441) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:305) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) ... 48 more Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'options' of bean class [com.fxcash.fxcore.application.impl.option.CoreCommandLineArgumentProcessorImpl]: Bean property 'options' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:721) at org.springframework.beans.factory.config.PropertyPathFactoryBean.getObject(PropertyPathFactoryBean.java:208) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142) ... 53 more

    Spring JIRA | 5 years ago | David Boden
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'core.CommandLineOptions': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'options' of bean class [com.fxcash.fxcore.application.impl.option.CoreCommandLineArgumentProcessorImpl]: Bean property 'options' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
  3. 0

    Writing a custom RefreshAheadCacheFactory with ehcache

    Stack Overflow | 2 years ago | blue-sky
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in class path resource [spring-ehcache.xml]: Cannot resolve reference to bean 'ehcache' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcache' defined in class path resource [spring-ehcache.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    NoSuchBeanDefinitionException only occurs on my pc

    Stack Overflow | 2 years ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0' while setting constructor argument with key [4]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0': Cannot resolve reference to bean 'org.springframework.security.authentication.ProviderManager#0' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.ProviderManager#0': Cannot resolve reference to bean 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'springSecurityService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityService' is defined
  6. 0

    Run/Debug Spring Boot Application from IntelliJ Idea

    Stack Overflow | 1 year ago | dbl001
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializerPostProcessor': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.beans.factory.BeanFactory org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerPostProcessor.beanFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.jpa.outbound.JpaOutboundGatewayFactoryBean#0': Cannot resolve reference to bean 'findDebtorAccountGateway.jpaExecutor' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'findDebtorAccountGateway.jpaExecutor': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.jpa.outbound.JpaOutboundGatewayFactoryBean#1': Cannot resolve reference to bean 'findCreditorAccountGateway.jpaExecutor' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'findCreditorAccountGateway.jpaExecutor': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'entityManagerFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?

  1. esaar 2 times, last 4 months ago
  2. abrazeneb 34 times, last 3 months ago
  3. Piz 9 times, last 4 months ago
  4. haerick 4 times, last 6 months ago
  5. Andreas Häber 8 times, last 6 months ago
3 more registered users
7 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.beans.NotReadablePropertyException

    Invalid property 'options' of bean class [com.fxcash.fxcore.application.impl.option.CoreCommandLineArgumentProcessorImpl]: Bean property 'options' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

    at org.springframework.beans.BeanWrapperImpl.getPropertyValue()
  2. Spring Beans
    BeanDefinitionValueResolver.resolveReference
    1. org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729)
    2. org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:721)
    3. org.springframework.beans.factory.config.PropertyPathFactoryBean.getObject(PropertyPathFactoryBean.java:208)
    4. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
    5. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
    6. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109)
    7. org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1441)
    8. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:305)
    9. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    10. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    10 frames