HTTP Status 500 - Unable to show problem report: freemarker.template.TemplateModelException: Method

本文介绍了解决SSH项目部署到服务器后出现HTTP 500错误的过程,涉及Hibernate配置问题,通过调整hbm.xml文件中的DTD引用解决了DOM4J解析异常。

整合SSH时,讲项目发布到服务器上之后出现了一下的错误:

HTTP Status 500 - Unable to show problem report: freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on org.hibernate.exception.GenericJDBCException: Cannot open connection Class: freemarker.ext.beans.SimpleMethodModel File: SimpleMethodModel.java Method: exec Line: 130 - freemarker/ext/beans/SimpleMethodModel.java:130:-1

显示的是hibernate中的某个方法出现了错误,后将调用hql语句的方法单独在后台运行,显示可以正常运行,后重启电脑之后问题消失,

几天后再次出现这个问题,重启后仍然没有解决,后在后台运行时显示错误:

org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hibernate.org

此时可能是因为联网的问题,也可能不是,需要在hibernate3.jar中找到相关的dtd文件与项目中对应的cfg.xml与hbm.xml文件中的

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> 

与dtd中的相比较,发现不同后将hbm。xml中相应的代码修改为:

<!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

项目可以正常运行。安静

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值