我已经设置了Tapestry 5项目并且一切正常,直到我部署了Hibernate。我创建hibernate.xml文件和休眠xml文件问题
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/project</property>
<property name="connection.username">root</property>
<property name="connection.password">password12</property>
<property name="connection.pool_size">5</property>
<!-- Print SQL to stdout. -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="use_sql_comments">true</property>
<property name="generate_statistics">true</property>
<property name="hibernate.archive.autodetection">class, hbm</property>
<property name="hibernate.transaction.flush_before_completion">true</property>
<!-- Mapping files TODO: Classify those mappings in exact order and define the relations between them in entities some time later on.-->
<mapping class="rs.project.com.entities.Fruit"/>
<mapping class="rs.project.com.entities.Article"/>
</session-factory>
,它是OK,只要它的实现而言。但是,当我部署应用程序时,它定义了一些其他配置,可以在我的跟踪日志中看到它,并使用其他xml文件(基于它在日志中显示的映射),它是关于我使用的一个完全不同的项目前一阵子。事情是我看不到是什么原因导致了这样的行为,我真的很沮丧。我正在使用Tomcat Apache Catalina和MySQL进行Hibernate。另外,我做了一些研究,发现persistence.xml文件正在我的project.properties中使用,这有点奇怪。
persistence.xml.dir=${conf.dir}
驱动我的应用程序连接到MySQL是jdbc.mysql.driver.So我的目标是可能的定义,在这里会导致这样的行为,你怎么了,并解决它。
在此先感谢您的答案。
你在说什么跟踪日志? Tomcat日志? – Atif
是的,tomcat日志。 –