我们创建了一些我们所有项目都会使用的库,这些库将提供我们所有系统(登录,管理等)的基本功能。但应用程序本身可以使用另一个数据库。Persistence.xml中的两个持久化单元
我们所做的是使用两个持久单元创建Persistence.xml。并将所有核心库实体打包在一个名为“LN-model.jar”的jar文件中,并将所有“out-test app”实体放在“App-model.jar”中。但由于某种原因,我们仍然获得以下信息。
无法解析对应于持久性上下文REF-名称[xxxxlistener.InicializadorListener/EM]在被称为[gfdeploy#/用户/ zkropotkine/WORK/SeguridadCore/DIST模块的范围持久化单元/ gfdeploy/SeguridadCore-war_war]。请验证您的申请。
这是我们的persistence.xml
<persistence version="1.0" 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_1_0.xsd">
<persistence-unit name="x" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/x</jta-data-source>
<jar-file>App-model.jar</jar-file>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
</properties>
</persistence-unit>
<persistence-unit name="y" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/y</jta-data-source>
<jar-file>LN-model.jar</jar-file>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
通过我们把persistence.xml中在一个罐子里的路上,我们加入到我们的企业项目(EAR)。
您正在使用哪台服务器? – Premraj 2011-03-18 19:02:07
玻璃鱼2.1.1 – zkropotkine 2011-03-18 20:50:44