org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.test.test-gateway: Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchGateway': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: Class must not be null

Spring JIRA | Russ Miles | 9 years ago
  1. 0

    [INT-239] App context BeanCreationException raised when mixing annotation-driven integration components with XML integration tags - Spring JIRA

    spring.io | 11 months ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.test.test-gateway: Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchGateway': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: Class must not be null
  2. 0

    I combined 3 annotation driven components (a splitter, router and aggregator) into an application and everything worked fine. Then, when I added a <gateway/> element to generate a gateway that matched one of my service interfaces I got the following error when the application context was initialized: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.test.test-gateway: Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchGateway': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: Class must not be null at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:291) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:927) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:325) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:110) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:255) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:93) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:130) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flightSearchGateway': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: Class must not be null at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:140) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:114) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:90) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1272) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:216) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:184) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:167) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:422) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:497) at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:182) at org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:104) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:288) ... 18 more Caused by: java.lang.IllegalArgumentException: Class must not be null at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:122) at org.springframework.integration.config.MessageEndpointAnnotationPostProcessor.postProcessAfterInitialization(MessageEndpointAnnotationPostProcessor.java:111) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:357) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1393) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:137) ... 30 more The problem went away when I put all my Spring Integration configuration into the XML, but ideally a mix of the two would be the best option in my case and should really not cause an issue.

    Spring JIRA | 9 years ago | Russ Miles
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.test.test-gateway: Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchGateway': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: Class must not be null
  3. 0

    I combined 3 annotation driven components (a splitter, router and aggregator) into an application and everything worked fine. Then, when I added a <gateway/> element to generate a gateway that matched one of my service interfaces I got the following error when the application context was initialized: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.test.test-gateway: Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchGateway': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: Class must not be null at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:291) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:927) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:325) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:110) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:255) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:93) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:130) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flightSearchGateway': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: Class must not be null at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:140) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:114) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:90) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1272) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:216) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:184) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:167) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:422) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:497) at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:182) at org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:104) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:288) ... 18 more Caused by: java.lang.IllegalArgumentException: Class must not be null at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:122) at org.springframework.integration.config.MessageEndpointAnnotationPostProcessor.postProcessAfterInitialization(MessageEndpointAnnotationPostProcessor.java:111) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:357) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1393) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:137) ... 30 more The problem went away when I put all my Spring Integration configuration into the XML, but ideally a mix of the two would be the best option in my case and should really not cause an issue.

    Spring JIRA | 9 years ago | Russ Miles
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.test.test-gateway: Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchGateway': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: Class must not be null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    @Async annotation not working

    Stack Overflow | 4 years ago | manurajhada
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authenticationService' defined in URL [jar:file:/D:/Software/Softwares/apache-tomcat-6.0.33/temp/0-scd-web/WEB-INF/lib/security-integration-spring-1.0.1.jar!/META-INF/spring/security-impl-services-bundle-context.xml]: Unsatisfied dependency expressed through bean property 'internalAuthenticationService': : Error creating bean with name 'internalAuthenticationService': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: Class must not be null; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'internalAuthenticationService': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: Class must not be null
  6. 0

    BeanCreationException;nested exception is java.lang.IllegalArgument:Class must not be null

    Stack Overflow | 1 year ago | jate sun
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'subjectCcyDao' defined in file [D:\apache-tomcat-6.0.37\wtpwebapps\iEBP4JLSI-SETTLE\WEB-INF\classes\config\applicationContext-sys.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Class must not be null

    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

      Class must not be null

      at org.springframework.util.Assert.notNull()
    2. Spring Core
      AnnotationUtils.findAnnotation
      1. org.springframework.util.Assert.notNull(Assert.java:112)
      2. org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:122)
      2 frames
    3. Spring Integration Core
      MessageEndpointAnnotationPostProcessor.postProcessAfterInitialization
      1. org.springframework.integration.config.MessageEndpointAnnotationPostProcessor.postProcessAfterInitialization(MessageEndpointAnnotationPostProcessor.java:111)
      1 frame
    4. Spring Beans
      FactoryBeanRegistrySupport$1.run
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:357)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1393)
      3. org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:137)
      3 frames
    5. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)
      1 frame
    6. Spring Beans
      AbstractBeanFactory.getBean
      1. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:114)
      2. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:90)
      3. org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1272)
      4. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:216)
      5. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:184)
      6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:167)
      6 frames
    7. Spring Context
      CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject
      1. org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:422)
      2. org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:497)
      2 frames
    8. Spring Beans
      InjectionMetadata.injectFields
      1. org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:182)
      2. org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:104)
      2 frames
    9. Spring Context
      CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation
      1. org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:288)
      1 frame
    10. Spring Beans
      AbstractAutowireCapableBeanFactory.autowireBeanProperties
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:927)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:325)
      2 frames
    11. Spring TestContext
      SpringJUnit4ClassRunner.invokeTestMethod
      1. org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:110)
      2. org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
      3. org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:255)
      4. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:93)
      5. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:130)
      5 frames
    12. JUnit
      JUnit4ClassRunner.run
      1. org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
      2. org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
      3. org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
      4. org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
      5. org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
      5 frames
    13. JUnit4 Runner
      JUnit4TestReference.run
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
      1 frame
    14. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      5 frames