需要在application中添加
@ImportResource(locations = {
"classpath:applicationContext.xml" //此处为需要注入的bean.xml
}
也可以通过config方式注入,方法是一样的 稍后用到再补充,关键点是xml如何正确的引入
entityManagerFactory that could not be found.
报错
APPLICATION FAILED TO START
Description:
A component required a bean named ‘entityManagerFactory’ that could not be found.
Action:
Consider defining a bean named ‘entityManagerFactory’ in your configuration.
原因
老版的applicationContext.xml 中一般都有sessionfactory的部分,jap用的是entityManagerFactory,需要单独声明下才可以用
一般是这样定义的
<bean id="sessionProvider" class="com.weailove.common.spring.SpringHibernateSessionProvider" autowire="byName" />
<bean id=