休止状態に問題があります
トレース:
org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1586)
at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1212)
at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:107)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1520)
at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1194)
at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:107)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1506)
at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1188)
at hibernate.filling.HibernateFill.fillDetail(HibernateFill.java:22)
at scanningDirective.ScanningTimer$1.run(ScanningTimer.java:57)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hibernate.org
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1576)
... 11 more
実際、以前はうまく機能していて、プロジェクトをしばらく離れた後、なぜ機能しないのかわかりません。この瞬間に、いくつかのプラグインを日食などにインストールできました。もちろん理解していますコードを魔法のように変更することはできませんでした。では、そのような振る舞いの理由は何だと思いますか。
申し訳ありません...どうやって忘れたのですか...これがHibernate.cfg.xmlです
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.5//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.url">jdbc:postgresql://localhost:5432/mydb</property>
<property name="connection.username">postgres</property>
<property name="connection.password">1</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">2</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>
<!-- Names the annotated entity class -->
<mapping class="documentElements.Header"/>
<mapping class="documentElements.Detail"/>
</session-factory>
</hibernate-configuration>
私が変わってから
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.5//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
に:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
すべてが機能し始めました。なぜ最初にうまくいかなかったのかわかりません。Mabe プロジェクトを再起動する必要がありました...