java.lang.IllegalStateException

tip

If you're using boot 1.4.x you need to modify the @springBootTest annotation to @SpringBootTest(classes = DataFlowServerConfiguration.class). 1.3.8 doesn't have this problem as well.

tip

Spring Boot 1.4 changed their annotation system a little. Try using the @SpringBootApplication annotation for better results.


rafaelrafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • More details at: http://forum.springframework.org/showthread.php?p=49536#post49536 Essentially I have a constructor: public ClassFilteringLoadEventListener(final Map<String, Collection<? extends Object>> theListeners) { } wiring up with: <bean class="uk.ac.warwick.sbr.hibernate.ClassFilteringLoadEventListener"> <constructor-arg index="0"> <map> <entry key="anything"> <list> <bean class="uk.ac.warwick.sbr.hibernate.AutoWiringLoadedObjectListener"/> </list> </entry> </map> </constructor-arg> </bean> throws: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uk.ac.warwick.sbr.hibernate.ClassFilteringLoadEventListener' defined in class path resource [uk/ac/warwick/sbr/broken-context.xml]: Instantiation of bean failed; nested exception is java.lang.IllegalStateException: BeanWrapper does not hold a bean instance java.lang.IllegalStateException: BeanWrapper does not hold a bean instance at org.springframework.util.Assert.state(Assert.java:341) at org.springframework.beans.BeanWrapperImpl.getPropertyDescriptorInternal(BeanWrapperImpl.java:274) at org.springframework.beans.BeanWrapperImpl.getPropertyType(BeanWrapperImpl.java:323) at org.springframework.beans.PropertyEditorRegistrySupport.findCustomEditor(PropertyEditorRegistrySupport.java:233) at org.springframework.beans.PropertyTypeConverter.doTypeConversionIfNecessary(PropertyTypeConverter.java:100) at org.springframework.beans.PropertyTypeConverter.doTypeConversionIfNecessary(PropertyTypeConverter.java:73) at org.springframework.beans.PropertyTypeConverter.convertToTypedMap(PropertyTypeConverter.java:277) at org.springframework.beans.PropertyTypeConverter.doTypeConversionIfNecessary(PropertyTypeConverter.java:131) at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:853) at org.springframework.beans.factory.support.AbstractBeanFactory.doTypeConversionIfNecessary(AbstractBeanFactory.java:672) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:370) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:126) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:368) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:238) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:148) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:331) at uk.ac.warwick.sbr.TheTest.testItFails(TheTest.java:14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    via by Colin Yates,
  • More details at: http://forum.springframework.org/showthread.php?p=49536#post49536 Essentially I have a constructor: public ClassFilteringLoadEventListener(final Map<String, Collection<? extends Object>> theListeners) { } wiring up with: <bean class="uk.ac.warwick.sbr.hibernate.ClassFilteringLoadEventListener"> <constructor-arg index="0"> <map> <entry key="anything"> <list> <bean class="uk.ac.warwick.sbr.hibernate.AutoWiringLoadedObjectListener"/> </list> </entry> </map> </constructor-arg> </bean> throws: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uk.ac.warwick.sbr.hibernate.ClassFilteringLoadEventListener' defined in class path resource [uk/ac/warwick/sbr/broken-context.xml]: Instantiation of bean failed; nested exception is java.lang.IllegalStateException: BeanWrapper does not hold a bean instance java.lang.IllegalStateException: BeanWrapper does not hold a bean instance at org.springframework.util.Assert.state(Assert.java:341) at org.springframework.beans.BeanWrapperImpl.getPropertyDescriptorInternal(BeanWrapperImpl.java:274) at org.springframework.beans.BeanWrapperImpl.getPropertyType(BeanWrapperImpl.java:323) at org.springframework.beans.PropertyEditorRegistrySupport.findCustomEditor(PropertyEditorRegistrySupport.java:233) at org.springframework.beans.PropertyTypeConverter.doTypeConversionIfNecessary(PropertyTypeConverter.java:100) at org.springframework.beans.PropertyTypeConverter.doTypeConversionIfNecessary(PropertyTypeConverter.java:73) at org.springframework.beans.PropertyTypeConverter.convertToTypedMap(PropertyTypeConverter.java:277) at org.springframework.beans.PropertyTypeConverter.doTypeConversionIfNecessary(PropertyTypeConverter.java:131) at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:853) at org.springframework.beans.factory.support.AbstractBeanFactory.doTypeConversionIfNecessary(AbstractBeanFactory.java:672) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:370) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:126) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:368) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:238) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:148) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:331) at uk.ac.warwick.sbr.TheTest.testItFails(TheTest.java:14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    via by Colin Yates,
  • Error while Implementing HATEOAS in Spring
    via Stack Overflow by Sunil Ks
    ,
    • java.lang.IllegalStateException: BeanWrapper does not hold a bean instance at org.springframework.util.Assert.state(Assert.java:341) at org.springframework.beans.BeanWrapperImpl.getPropertyDescriptorInternal(BeanWrapperImpl.java:274) at org.springframework.beans.BeanWrapperImpl.getPropertyType(BeanWrapperImpl.java:323) at org.springframework.beans.PropertyEditorRegistrySupport.findCustomEditor(PropertyEditorRegistrySupport.java:233) at org.springframework.beans.PropertyTypeConverter.doTypeConversionIfNecessary(PropertyTypeConverter.java:100) at org.springframework.beans.PropertyTypeConverter.doTypeConversionIfNecessary(PropertyTypeConverter.java:73) at org.springframework.beans.PropertyTypeConverter.convertToTypedMap(PropertyTypeConverter.java:277) at org.springframework.beans.PropertyTypeConverter.doTypeConversionIfNecessary(PropertyTypeConverter.java:131) at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:853) at org.springframework.beans.factory.support.AbstractBeanFactory.doTypeConversionIfNecessary(AbstractBeanFactory.java:672) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:370) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:126) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:368) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:238) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:148) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:331) at uk.ac.warwick.sbr.TheTest.testItFails(TheTest.java:14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

    Users with the same issue

    tvrmsmithtvrmsmith
    23 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    AxeloAxelo
    1 times, last one,
    olle.hallinolle.hallin
    2 times, last one,
    Nikolay RybakNikolay Rybak
    4 times, last one,
    62 more bugmates