org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'statelessZoneDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.beans.factory.ObjectFactory biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory; nested exception is java.lang.IllegalArgumentException: Can not set org.springframework.beans.factory.ObjectFactory field biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory to biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneRestrictIpDAOImpl

Spring JIRA | Jeffrey Damick | 5 years ago
  1. 0

    Autowiring of a prototype scoped bean into an ObjectFactory now fails with 3.1.1, however it works on 3.0.x & 3.1.0. For example we something like: {code} @Component @Scope("prototype") public class SomePrototypeBean { } @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ "/test-context.xml" }) public class SomeTest { @Autowired ObjectFactory<SomePrototypeBean> prototypeBeanFactory; @Test public void test() { SomePrototypeBean b = prototypeBeanFactory.getObject(); assertNotNull(b); } } {code} Below is a real stack from our unit tests: {noformat} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'statelessZoneDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.beans.factory.ObjectFactory biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory; nested exception is java.lang.IllegalArgumentException: Can not set org.springframework.beans.factory.ObjectFactory field biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory to biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneRestrictIpDAOImpl at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:313) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790) at org.springframework.beans.factory.support.DefaultListableBeanFactory$DependencyObjectFactory.getObject(DefaultListableBeanFactory.java:1010) at biz.neustar.ultra.model.persistence.DbWriterImpl.writeVersionedStyle(DbWriterImpl.java:169) at biz.neustar.ultra.model.persistence.ChunkOperationsImplTest.blowChunks(ChunkOperationsImplTest.java:83) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.beans.factory.ObjectFactory biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory; nested exception is java.lang.IllegalArgumentException: Can not set org.springframework.beans.factory.ObjectFactory field biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory to biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneRestrictIpDAOImpl at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284) Caused by: java.lang.IllegalArgumentException: Can not set org.springframework.beans.factory.ObjectFactory field biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory to biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneRestrictIpDAOImpl at java.lang.reflect.Field.set(Field.java:657) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502) {noformat}

    Spring JIRA | 5 years ago | Jeffrey Damick
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'statelessZoneDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.beans.factory.ObjectFactory biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory; nested exception is java.lang.IllegalArgumentException: Can not set org.springframework.beans.factory.ObjectFactory field biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory to biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneRestrictIpDAOImpl
  2. 0

    Autowiring of a prototype scoped bean into an ObjectFactory now fails with 3.1.1, however it works on 3.0.x & 3.1.0. For example we something like: {code} @Component @Scope("prototype") public class SomePrototypeBean { } @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ "/test-context.xml" }) public class SomeTest { @Autowired ObjectFactory<SomePrototypeBean> prototypeBeanFactory; @Test public void test() { SomePrototypeBean b = prototypeBeanFactory.getObject(); assertNotNull(b); } } {code} Below is a real stack from our unit tests: {noformat} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'statelessZoneDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.beans.factory.ObjectFactory biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory; nested exception is java.lang.IllegalArgumentException: Can not set org.springframework.beans.factory.ObjectFactory field biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory to biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneRestrictIpDAOImpl at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:313) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790) at org.springframework.beans.factory.support.DefaultListableBeanFactory$DependencyObjectFactory.getObject(DefaultListableBeanFactory.java:1010) at biz.neustar.ultra.model.persistence.DbWriterImpl.writeVersionedStyle(DbWriterImpl.java:169) at biz.neustar.ultra.model.persistence.ChunkOperationsImplTest.blowChunks(ChunkOperationsImplTest.java:83) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.beans.factory.ObjectFactory biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory; nested exception is java.lang.IllegalArgumentException: Can not set org.springframework.beans.factory.ObjectFactory field biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory to biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneRestrictIpDAOImpl at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284) Caused by: java.lang.IllegalArgumentException: Can not set org.springframework.beans.factory.ObjectFactory field biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory to biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneRestrictIpDAOImpl at java.lang.reflect.Field.set(Field.java:657) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502) {noformat}

    Spring JIRA | 5 years ago | Jeffrey Damick
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'statelessZoneDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.beans.factory.ObjectFactory biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory; nested exception is java.lang.IllegalArgumentException: Can not set org.springframework.beans.factory.ObjectFactory field biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory to biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneRestrictIpDAOImpl
  3. 0

    spring - forcing cglib proxies for @Autowired fields

    Stack Overflow | 2 years ago | Peter Butkovic
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'classB': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private ClassA ClassB.classA; nested exception is java.lang.IllegalArgumentException: Can not set ClassA field ClassB.classA to com.sun.proxy.$Proxy257.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Troubleshooting (The Java™ Tutorials > The Reflection API > Arrays and Enumerated Types)

    oracle.com | 12 months ago
    java.lang.IllegalArgumentException: Can not set E0 field ETest.fld to E1 at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException (UnsafeFieldAccessorImpl.java:146) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException (UnsafeFieldAccessorImpl.java:150) at sun.reflect.UnsafeObjectFieldAccessorImpl.set (UnsafeObjectFieldAccessorImpl.java:63)
  6. 0

    How to tell which field failed Gson serialization

    Stack Overflow | 3 years ago | styler1972
    java.lang.IllegalArgumentException: invalid value for field

  1. Indri Yunita 183 times, last 3 days ago
  2. Alexandru Popa 1 times, last 3 weeks ago
  3. filpgame 5 times, last 1 week ago
  4. eti22 4 times, last 3 months ago
  5. smyrgeorge 1 times, last 4 months ago
2 more registered users
27 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. java.lang.IllegalArgumentException

    Can not set org.springframework.beans.factory.ObjectFactory field biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneDAOImpl.zriDAOFactory to biz.neustar.ultra.model.rdb.dao.hibernate.stateless.ZoneRestrictIpDAOImpl

    at java.lang.reflect.Field.set()
  2. Java RT
    Field.set
    1. java.lang.reflect.Field.set(Field.java:657)
    1 frame
  3. Spring Beans
    AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject
    1. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502)
    1 frame