仔细查看一下错误,不确定是配置文件的问题还是程序问题。数据库能连上,其他信息也应该没问题。
出错在:
private static Configuration configuration; private static SessionFactory sessionFactory; static {
try {
configuration = new Configuration().configure("hibernate.cfg.xml");
sessionFactory = configuration.buildSessionFactory();
logger.debug("Hibernate initialize completed!");
} catch (Throwable ex) {
logger.error("报错内容........."+ex.getMessage());
}
}ps:在tomcat中无问题。我在从tomcat导入resin过程中,web.xml的头文件修改了一下,别的没动。
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
换成了
<web-app xmlns="http://caucho.com/ns/resin">