【发布时间】:2015-07-29 07:50:09
【问题描述】:
使用 maven 将 web 应用程序部署到 heroku 云后,出现日志错误:
app[web.1]: org.hibernate.HibernateException: hibernate.cfg.xml 未找到。
Web 应用程序在本地正确运行,但在云上却没有。
这是我的hibernate.cfg.xml:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/todoitemsdb
</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping class="il.ac.hit.model.User" resource="todoitems.xml"/>
<mapping class="il.ac.hit.model.ToDoItem" resource="users.xml"/>
</session-factory>
</hibernate-configuration>
我能做什么?
【问题讨论】:
标签: java xml hibernate maven heroku