您的位置:首页 > 运维架构 > Tomcat

程序在tomcat运行正常,但部署到websphere会启动失败(org.hibernate.InvalidMappingException: Could not parse mapping doc)

2016-02-04 16:30 831 查看
报错信息:

Context initialization failed

Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/config/application-context.xml]: Invocation of init method failed; 

nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream

错误原因:配置文件出错。

使用Hibernate Tools 4.3.1.Final自动生成的*.hbm.xml文件中,文档类型(DOCTYPE )有问题

解决方案:

文档类型由

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"

"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

改为

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"

"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  hibernate websphere