0
使用glassfish,我的persistence.xml未加載。JPA persistence.xml未加載
my.ear
META-INF/persistence.xml
lib/entities.jar <!-- no persistence.xml here -->
的persistence.xml包含
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="xxxPU" transaction-type="JTA">
<jta-data-source>jdbc/xxxDS</jta-data-source>
<jar-file>lib/entities.jar</jar-file>
</persistence-unit>
</persistence>
成功部署,但是,我得到了。
Unable to retrieve EntityManagerFactory for unitName xxxPU
謝謝。
你的jpaEntityManagerFactory bean是怎麼樣的? – heldt 2012-04-03 05:44:21
我剛剛發現將persistence.xml放置在EAR的META-INF /中不是標準方法。任何人都可以證實這一點? 我創建了一個持久性存檔,它可以工作。 – 2012-04-03 07:48:30