0

orm.xmlで構成するたびPersistance.xmlに、次のようになります。

E CWWJP0015E: org.hibernate.ejb.HibernatePersistence 持続性プロバイダーが XYZ 持続性ユニットのコンテナー・エンティティー・マネージャー・ファクトリーを作成しようとしたときに、エラーが発生しました。次のエラーが発生しました: PersistenceUnit: XYZ Unable to build EntityManagerFactory

エントリを削除すると正常にPersistance.xml動作しますが、JPA アノテーションを使用していないため、エンティティ マネージャはエンティティ クラスを見つけることができません。

4

1 に答える 1

0

は小文字であり、「永続性」という単語には文字が含まれていないことPersistance.xmlpersistence.xml 注意してください。pa

また、persistence.xml適切な場所にあることを確認してください。

以下はJPA 仕様からのものです。

A persistence.xml file defines a persistence unit. The persistence.xml file is 
located in the META-INF directory of the root of the persistence unit. 
The root of the persistence unit is the key here.

非 Java EE アプリの場合

The jar file or directory whose META-INF directory contains the persistence.xml 
file is termed the root of the persistence unit.

Java EE アプリを使用している場合、以下が有効です。

Java EE 環境では、持続性ユニットのルートは次のいずれかでなければなりません。

• EJB-JAR ファイル

• WAR ファイルの WEB-INF/classes ディレクトリ [80]

• WAR ファイルの WEB-INF/lib ディレクトリにある jar ファイル

• EAR ライブラリ ディレクトリの jar ファイル

• アプリケーション クライアント jar ファイル

于 2013-11-12T01:50:14.410 に答える