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
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  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 | 3 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 | 1 year 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

    The Berkeley DB Java Edition Package: BDB JE Library Version 11.2.4.0 (Release 4.0.117) Change Log

    oracle.com | 2 days ago
    java.lang.IllegalArgumentException: Can not set java.lang.Integer field com.sleepycat.persist.test.EvolveClasses$RenameSecField.new_secKey2 to java.lang.String

  1. Andreas Häber 5 times, last 4 weeks ago
  2. linxiaolong 8 times, last 3 months ago
  3. Hronom 1 times, last 4 months ago
  4. kjhdofjosvs 3 times, last 4 months ago
  5. Indri Yunita 236 times, last 5 months ago
6 more registered users
28 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