org.springframework.beans.factory.BeanDefinitionStoreException: 1 constructor arguments specified but no matching constructor found in bean 'testSpring01'

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • when executing the following code XmlBeanFactory xbf = new XmlBeanFactory(new FileInputStream(file)); Object bean = (IEvent)xbf.getBean("testSpring01"); where file points to the following xml file <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans SYSTEM "../dtd/spring-beans.dtd" > <beans > <bean id="testInteger01" class="java.lang.Integer" singleton="false"> <constructor-arg><value>5</value></constructor-arg> </bean> <bean id="testSpring01" class="com.ricky.TestSpring" singleton="false" > <property name="attributes"> <map> <entry key="value01"><value>value01</value></entry> <entry key="nullValue"><value/></entry> <entry key="integerAttribute01"> <ref bean="testInteger01"/> </entry> <entry key="integerAttribute02"> <bean id="nestedInteger" class="java.lang.Integer" singleton="false"> <constructor-arg><value>5</value></constructor-arg> </bean> </entry> </map> </property> </bean> </beans> the following exception is printed on my console 0 [main] INFO xml.XmlBeanDefinitionReader - Loading XmlBeanFactory from resource [(no description] org.springframework.beans.factory.BeanDefinitionStoreException: 1 constructor arguments specified but no matching constructor found in bean 'testSpring01' at org.springframework.beans.factory.support.AbstractBeanFactory.autowireConstructor(AbstractBeanFactory.java:631) at org.springframework.beans.factory.support.AbstractBeanFactory.createBean(AbstractBeanFactory.java:532) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at com.ricky.TestSpringApp.main(TestSpringApp.java:47) Exception in thread "main" Some debugging showed that the constructor context is not propagated down the chain. That is, the constructor is still the com.ricky.TestSpring rather than the java.lang.Integer one.
    via by Ricky Nuyens,
  • when executing the following code XmlBeanFactory xbf = new XmlBeanFactory(new FileInputStream(file)); Object bean = (IEvent)xbf.getBean("testSpring01"); where file points to the following xml file <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans SYSTEM "../dtd/spring-beans.dtd" > <beans > <bean id="testInteger01" class="java.lang.Integer" singleton="false"> <constructor-arg><value>5</value></constructor-arg> </bean> <bean id="testSpring01" class="com.ricky.TestSpring" singleton="false" > <property name="attributes"> <map> <entry key="value01"><value>value01</value></entry> <entry key="nullValue"><value/></entry> <entry key="integerAttribute01"> <ref bean="testInteger01"/> </entry> <entry key="integerAttribute02"> <bean id="nestedInteger" class="java.lang.Integer" singleton="false"> <constructor-arg><value>5</value></constructor-arg> </bean> </entry> </map> </property> </bean> </beans> the following exception is printed on my console 0 [main] INFO xml.XmlBeanDefinitionReader - Loading XmlBeanFactory from resource [(no description] org.springframework.beans.factory.BeanDefinitionStoreException: 1 constructor arguments specified but no matching constructor found in bean 'testSpring01' at org.springframework.beans.factory.support.AbstractBeanFactory.autowireConstructor(AbstractBeanFactory.java:631) at org.springframework.beans.factory.support.AbstractBeanFactory.createBean(AbstractBeanFactory.java:532) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at com.ricky.TestSpringApp.main(TestSpringApp.java:47) Exception in thread "main" Some debugging showed that the constructor context is not propagated down the chain. That is, the constructor is still the com.ricky.TestSpring rather than the java.lang.Integer one.
    via by Ricky Nuyens,
    • org.springframework.beans.factory.BeanDefinitionStoreException: 1 constructor arguments specified but no matching constructor found in bean 'testSpring01' at org.springframework.beans.factory.support.AbstractBeanFactory.autowireConstructor(AbstractBeanFactory.java:631) at org.springframework.beans.factory.support.AbstractBeanFactory.createBean(AbstractBeanFactory.java:532) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at com.ricky.TestSpringApp.main(TestSpringApp.java:47)

    Users with the same issue

    Unknown visitor1 times, last one,