users@glassfish.java.net

Re: Persistence unit ref:

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Fri, 04 Dec 2009 12:17:05 -0800

This is what the JavaEE spec gives as an example:
<persistence-unit-ref>
   <persistence-unit-ref-name>
     persistence/InventoryAppDB
   </persistence-unit-ref-name>
   <persistence-unit-name>
     InventoryManagement
   </persistence-unit-name>
</persistence-unit-ref>

-marina

Eve Pokua wrote:
> Yes,
>
> I can ping.
>
> I can input data into the DB and retrieve data too.
>
> All I need to know is-
>
> persistence-unit-ref-name??
>
> Do I add this to my per.xml?
>
> How do I do it?
>
> I need to add the persistence-unit-ref-name to my web.xml.
>
> regards
>
> eve
>
>
>
>
> > Date: Fri, 4 Dec 2009 12:03:51 -0800
> > From: Marina.Vatkina_at_Sun.COM
> > To: users_at_glassfish.dev.java.net
> > Subject: Re: Persistence unit ref:
> >
> > Can you ping jdbc_/EnterpriseDB2 resource?
> >
> > thanks,
> > -marina
> >
> > Eve Pokua wrote:
> > > Ralph,
> > >
> > > Here is my per.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="ENTERPRISE-ejbPU" transaction-type="JTA">
> > > <jta-data-source>jdbc_/EnterpriseDB2</jta-data-source>
> > > <exclude-unlisted-classes>false</exclude-unlisted-classes>
> > > <properties>
> > > </properties>
> > > </persistence-unit>
> > > </persistence>
> > >
> > >
> > > regards
> > >
> > > eve
> > >
> > >
> ------------------------------------------------------------------------
> > > From: ralph.winzinger_at_senacor.de
> > > To: users_at_glassfish.dev.java.net
> > > Date: Fri, 4 Dec 2009 15:20:16 +0100
> > > Subject: Re: Persistence unit ref:
> > >
> > > hi,
> > >
> > > what does your persistence.xml look like?
> > >
> > >
> > > Am 04.12.2009 um 13:50 schrieb Eve Pokua:
> > >
> > > Ralph,
> > >
> > > Thank you for your reply.
> > >
> > > I did as you said.
> > >
> > > i added the following to my web.xml
> > >
> > >
> > >
> > > <persistence-unit-ref>
> > >
> <persistence-unit-ref-name>persistence/ENTERPRISE-ejbPU</persistence-unit-ref-name>
> > > <persistence-unit-name>ENTERPRISE-ejbPU</persistence-unit-name>
> > > </persistence-unit-ref>
> > >
> > >
> > >
> > > in my applicationContext.xml
> > >
> > > <bean
> > >
> class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"
> > > >
> > > <property name="persistenceUnits">
> > > <map>
> > > <entry key="MyPU" value="persistence/ENTERPRISE-ejbPU"/>
> > > </map>
> > > </property>
> > > </bean>
> > >
> > > <!--
> > > see
> http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/transaction/jta/JtaTransactionManager.html
> -->
> > > <tx:jta-transaction-manager/>
> > > <!--
> > > see
> http://static.springsource.org/spring/docs/2.5.x/reference/transaction.html
> -->
> > > <tx:annotation-driven/>
> > >
> > >
> > > But I still get the error -
> > >
> > >
> [#|2009-12-04T12:34:05.536+0000|SEVERE|sun-appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=20;_ThreadName=Thread-48;_RequestID=3fb89f4d-e8ef-403f-a422-9e5442bf9b3a;|Exception
> > > occured in J2EEC Phase
> > > com.sun.enterprise.deployment.backend.IASDeploymentException: Could
> > > not resolve a persistence unit corresponding to the
> > > persistence-unit-ref-name [persistence/ENTERPRISE-ejbPU] in scope of
> > > the module called
> > > [gfdeploy#C:\jee\ENTERPRISE\dist\gfdeploy\ENTERPRISE-war_war].
> > > Please verify your application.
> > > at
> > >
> com.sun.enterprise.deployment.BundleDescriptor.findReferencedPUsViaPURefs(BundleDescriptor.java:711)
> > > at
> > >
> com.sun.enterprise.deployment.WebBundleDescriptor.findReferencedPUs(WebBundleDescriptor.java:727)
> > > at
> > >
> com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.getAllPersistenceUnitDescriptors(PersistenceProcessor.java:214)
> > > at
> > >
> com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:175)
> > > 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:401)
> > > at
> > >
> com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:260)
> > > at
> > >
> com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:148)
> > > at
> > >
> com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:208)
> > > at
> > >
> com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
> > > at
> > >
> com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
> > > at
> > >
> com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:283)
> > > at
> > >
> com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:835)
> > > at
> > >
> com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
> > > at
> > >
> com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:225)
> > > |#]
> > >
> [#|2009-12-04T12:37:03.074+0000|INFO|sun-appserver2.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;;|Initializing
> > > Sun's JavaServer Faces implementation (1.2_04-b22-p05) for context
> ''|#]
> > >
> [#|2009-12-04T12:37:58.729+0000|INFO|sun-appserver2.1|com.sun.jbi.framework|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|JBIFW0012:
> > > JBI framework startup complete.|#]
> > >
> > >
> > > sO MY QUESTION AGAIN IS - WHERE CAN I FIND A REFERENCE
> > > TO MY persistence-unit-ref-name????
> > >
> > > I'VE CHECKED MY domain.xml but no details.
> > >
> > > thanks
> > >
> > > eve
> > >
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > > From: ralph.winzinger_at_senacor.com <mailto:ralph.winzinger_at_senacor.com>
> > > To: users_at_glassfish.dev.java.net <mailto:users_at_glassfish.dev.java.net>
> > > Date: Fri, 4 Dec 2009 00:42:46 +0100
> > > Subject: Re: Persistence unit ref:
> > >
> > > Hi,
> > >
> > > I got this working just about an ago ...
> > >
> > > web.xml:
> > >
> > > <persistence-unit-ref>
> > >
> > > <persistence-unit-ref-name>persistence/hd</persistence-unit-ref-name>
> > > <persistence-unit-name>hd</persistence-unit-name>
> > > </persistence-unit-ref>
> > >
> > > application-context.xml:
> > >
> > > <bean
> class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"
> >
> > > <property name="persistenceUnits">
> > > <map>
> > > <entry key="MyPU" value="persistence/hd"/>
> > > </map>
> > > </property>
> > > </bean>
> > >
> > > <!-- see
> > >
> <http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/transaction/jta/JtaTransactionManager.html>http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/transaction/jta/JtaTransactionManager.html
> -->
> > > <tx:jta-transaction-manager/>
> > > <!-- see
> > >
> <http://static.springsource.org/spring/docs/2.5.x/reference/transaction.html>http://static.springsource.org/spring/docs/2.5.x/reference/transaction.html
> -->
> > > <tx:annotation-driven/>
> > >
> > > Hope this helps ...
> > >
> > > Bye,
> > > Ralph
> > >
> > >
> > > Kurz gehalten, da vom iPhone gesendet
> > >
> > > Am 04.12.2009 um 00:16 schrieb "Eve Pokua" <gorgeous65_at_msn.com
> > > <mailto:gorgeous65_at_msn.com>>:
> > >
> > > Hello,
> > >
> > > Below is my persistence.xml-
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <persistence version="1.0" xmlns="
> > >
> <http://java.sun.com/xml/ns/persistence>http://java.sun.com/xml/ns/persistence"
> > > xmlns:xsi="
> > >
> <http://www.w3.org/2001/XMLSchema-instance>http://www.w3.org/2001/XMLSchema-instance"
> > > xsi:schemaLocation="
> > >
> <http://java.sun.com/xml/ns/persistence>http://java.sun.com/xml/ns/persistence
>
> > >
> <http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd>http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
> > > <persistence-unit name="ENTERPRISE-ejbPU" transaction-type="JTA">
> > > <jta-data-source>jdbc_/EnterpriseDB2</jta-data-source>
> > > <exclude-unlisted-classes>false</exclude-unlisted-classes>
> > > <properties>
> > > </properties>
> > > </persistence-unit>
> > > </persistence>
> > >
> > >
> > > How do I find the name of my -persistence-unit-ref-name?
> > >
> > > I use the following and I get deployment error
> > >
> > > <persistence-unit-ref-name>ENTERPRISE-ejbPU</persistence-unit-ref-name>
> > >
> > > Deploying application in domain failed; Could not resolve a
> > > persistence unit corresponding to the persistence-unit-ref-name
> > > [ENTERPRISE-ejbPU] in scope of the module called
> > > [gfdeploy#C:\jee\ENTERPRISE\dist\gfdeploy\ENTERPRISE-war_war].
> > > Please verify your application.
> > >
> > > I need to specify it within my web.xml in-order to use
> > > @Persistence in my spring JEE
> > > application.
> > >
> > > Thanking you.
> > >
> > > eve
> > >
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > > Use Hotmail to send and receive mail from your different email
> > > accounts. Find out how.
> > > <http://clk.atdmt.com/UKM/go/186394592/direct/01/>
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > > New! Receive and respond to mail from other email accounts from
> > > within Hotmail Find out how.
> > > <http://clk.atdmt.com/UKM/go/186394593/direct/01/>
> > >
> > >
> > > Ralph Winzinger
> > > Principal Architect
> > > ______________________________
> > > Senacor Technologies AG
> > > Vordere Cramergasse 11
> > > 90478 Nürnberg
> > >
> > > Telefon: +49 (0)911 4244-202
> > > Telefax: +49 (0)911 4244-100
> > >
> > > ralph.winzinger_at_senacor.com <mailto:ralph.winzinger_at_senacor.com>
> > > www.senacor.com <http://www.senacor.com/>
> > >
> > > Senacor Technologies Aktiengesellschaft - Sitz: Nürnberg - Amtsgericht
> > > Nürnberg - Reg.-Nr.: HRB 23098
> > > Vorstand: Matthias Tomann, Marcus Purzer - Aufsichtsratsvorsitzender:
> > > Mathias J. Lindermeir
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > > Add other email accounts to Hotmail in 3 easy steps. Find out how.
> > > <http://clk.atdmt.com/UKM/go/186394593/direct/01/ >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> > For additional commands, e-mail: users-help_at_glassfish.dev.java.net
> >
>
> ------------------------------------------------------------------------
> Have more than one Hotmail account? Link them together to easily access
> both. < http://clk.atdmt.com/UKM/go/186394591/direct/01/>