org.springframework.beans.factory.BeanCreationException

java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:202)
    at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:251)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:248)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘departmentDao‘ 

defined in class path resource [spring/applicationContext-department.xml]: Cannot resolve reference to bean 

‘hibernateTemplate‘ while setting bean property ‘hibernateTemplate‘; nested exception is 

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘hibernateTemplate‘ is defined
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference

(BeanDefinitionValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary

(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues

(AbstractAutowireCapableBeanFactory.java:1317)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean

(AbstractAutowireCapableBeanFactory.java:1076)
    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$1.getObject

(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton

(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons

(DefaultListableBeanFactory.java:563)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization

(AbstractApplicationContext.java:872)
    at org.springframework.context.support.AbstractApplicationContext.refresh

(AbstractApplicationContext.java:423)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>

(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>

(ClassPathXmlApplicationContext.java:83)
    at com.itjb.ssh.test.SpringUtils.<clinit>(SpringUtils.java:9)
    ... 22 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘hibernateTemplate‘ is 

defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition

(DefaultListableBeanFactory.java:510)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition

(AbstractBeanFactory.java:1056)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference

(BeanDefinitionValueResolver.java:322)
    ... 37 more

strtus2+spring+hibernante合并过程中出错.

问题原因:applicationContext-db.xml配置文件中缺少定义

<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
		<property name="sessionFactory">
			<ref bean="sessionFactory"/>
		</property>
	</bean>

  初学者.

时间: 2024-10-24 10:11:41

org.springframework.beans.factory.BeanCreationException的相关文章

Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException:

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoSupport': Injection of resou

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field

1 错误描述 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.sc.oa.test.timer.dao.TimerDaoTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationExcep

Caused by: org.springframework.beans.factory.BeanCreationException

1.错误原因 2014-7-13 17:36:57 org.apache.jasper.compiler.TldLocationsCache tldScanJar 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were fou

@Repository 注解引发的异常: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field

手头的项目使用spring mvc+ mybatis框架开发,今天调试时遇到奇怪的问题, biz层的ManagerImpl.java 一直报错: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field.... 逐一检查了Dao层.biz层.service层的文件,

org.springframework.beans.factory.BeanCreationException: Error creating bean with name

这个问题在别人电脑上面没有出现,但我的电脑就出现了,在网上找各种解决方法:有的说是asm.jar冲突,有的说要配置byName,有的说是路径问题但路径明显是正确的. 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.B

org.springframework.beans.factory.BeanCreationException: 求教育!

2014-11-26 14:05:56 [org.springframework.web.context.support.XmlWebApplicationContext]-[WARN] Exception encountered during context initialization - cancelling refresh attemptorg.springframework.beans.factory.BeanCreationException: Error creating bean

ssm整合时出现 org.springframework.beans.factory.BeanCreationException :Error creating bean with name ‘XXX’ 异常的原因及解决方法

ssm整合时出现 org.springframework.beans.factory.BeanCreationException :Error creating bean with name 'XXX' 异常的原因及解决方法(只是可能出现下列几种,不包含全部) 此异常为:注入 bean 失败异常,也就是找不到注入的bean. 可能有以下几种原因: 1.bean未注解或者注解错误 2.项目整合的时候jar包冲突 3.'XXX'的配置有错误 解决:1,3仔细检查就是,网上大部分的人应该是2这种错误,

struts2和spring整合错误 org.springframework.beans.factory.BeanCreationException,已解决

先贴上错误 2018-8-16 23:41:10 org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh信息: Refreshing org[email protected]5492bbba: startup date [Thu Aug 16 23:41:10 CST 2018]; root of context hierarchy2018-8-16 23:41:10 org.spring

【报错】org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#39;webSocketHandlerMapping&#39; defined in class path resource

环境:maven+eclipse+jdk1.8 [tomcat使用的是maven自带的插件,实质原因就是出在tomcat版本问题] 背景:在进行SSM集成WebSocket的时候,项目启动报org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketHandlerMapping' defined in class path resource错误,详细如下 org.