青春永不散场,我们的爱地久天长

假如你的人生有理想,那么就一定要去追,不管你现在的理想在别人看来是 多么的可笑,你也不用在乎...

spring org.springframework.beans.factory.BeanCreationException

信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@13b7064: defining beans [usebean,hello,enhellobean,zhhellobean,mybean,a,b]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'a' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ioc.spring4.A]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.ioc.spring4.A.<init>()
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
	at com.ioc.spring4.Test.main(Test.java:9)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ioc.spring4.A]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.ioc.spring4.A.<init>()
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:58)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
	... 16 more
Caused by: java.lang.NoSuchMethodException: com.ioc.spring4.A.<init>()
	at java.lang.Class.getConstructor0(Class.java:2800)
	at java.lang.Class.getDeclaredConstructor(Class.java:2043)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:54)
	... 17 more

阅读更多
个人分类: spring
上一篇如何myeclipse导入到eclipse中
下一篇我的2013———大四学生成长记
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭