Change
@PersistenceContext(name="derby2")
to
@PersistenceContext(unitName="derby2")
Thanks,
Sahoo
glassfish_at_javadesktop.org wrote:
> Hello,
>
> i want to deploy a smal Project.
> I have two Persistence Units in the persistence.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <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="derby1" transaction-type="JTA">
> <provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
> <jta-data-source>testResource</jta-data-source>
> <exclude-unlisted-classes>false</exclude-unlisted-classes>
> <properties>
> <property name="toplink.ddl-generation" value="create-tables"/>
> </properties>
> </persistence-unit>
> <persistence-unit name="derby2" transaction-type="JTA">
> <provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
> <jta-data-source>travel</jta-data-source>
> <properties>
> <property name="toplink.ddl-generation" value="create-tables"/>
> </properties>
> </persistence-unit>
> </persistence>
>
> SessionBean:
> @PersistenceContext(name="derby2")
>
> If i have only on PU in the persistence.xml it works fine. With both entries!
> With bothe entries i get an Error:
> Deploying application in domain failed; Could not resolve a persistence unit corresponding to the persistence-context-ref-name [derby2] in the scope of the module called []. Please verify your application.
> D:\home\270553\quellcode\netBeans-workspace\TestJpaXmlAnnotationEnterpriseApplication\nbproject\build-impl.xml:183: Deployment error:
> The module has not been deployed.
> See the server log for details.
>
> Here is the Server.log:
> [#|2007-08-22T08:44:46.697+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=15;_ThreadName=Thread-26;_RequestID=e8ff8d7d-e95e-4b86-9f2a-edae49e10244;|Exception occured in J2EEC Phase
> com.sun.enterprise.deployment.backend.IASDeploymentException: Could not resolve a persistence unit corresponding to the persistence-context-ref-name [derby2] in the scope of the module called []. Please verify your application.
> at com.sun.enterprise.deployment.BundleDescriptor.findReferencedPUsViaPCRefs(BundleDescriptor.java:702)
> at com.sun.enterprise.deployment.EjbBundleDescriptor.findReferencedPUs(EjbBundleDescriptor.java:862)
> at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.getAllPersistenceUnitDescriptors(PersistenceProcessor.java:165)
> at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:132)
> at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processApplication(DeploymentEventListenerImpl.java:211)
> at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processEvent(DeploymentEventListenerImpl.java:172)
> at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.notifyDeploymentEvent(DeploymentEventListenerImpl.java:122)
> at com.sun.enterprise.deployment.backend.DeploymentEventManager.notifyDeploymentEvent(DeploymentEventManager.java:79)
> at com.sun.enterprise.deployment.backend.AppDeployer.postDeploy(AppDeployer.java:391)
> at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:250)
> at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:148)
> at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:187)
> at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
> at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:905)
> at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:279)
> at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:774)
> at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
> at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:223)
>
> Who knows the problem and a solution?
>
> Best regards
> dreiplatz
> [Message sent by forum member 'dreiplatz' (dreiplatz)]
>
> http://forums.java.net/jive/thread.jspa?messageID=231945
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>