SSH整合:Spring的xml文件里写Hibernate调用时bean加载问题

SSH整合:Spring的xml文件里写Hibernate调用时bean加载问题

Error creating

bean with name 'sessionFactory' defined in class path resource [applicationContext1.xml]: Invocation of init method failed;

nested exception is javax

 

意思是:

在类路径资源applicationContext1中定义的“sessionFactory”创建bean错误。

xml:init方法的调用失败;嵌套异常是javax.xml.stream。com.bea.xml.stream FactoryConfigurationError:提供者。

EventFactory未找到.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found

 

解决方法:

将Hibernate文件写在外面,在Spring 引入 Hibernate的xml文件

hibernate的xml文件

SSH整合:Spring的xml文件里写Hibernate调用时bean加载问题

Spring的xml文件

SSH整合:Spring的xml文件里写Hibernate调用时bean加载问题