users@glassfish.java.net

RE: Persistence unit ref:

From: Eve Pokua <gorgeous65_at_msn.com>
Date: Fri, 4 Dec 2009 12:50:51 +0000

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
To: 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 -->
<tx:jta-transaction-manager/>
<!-- see 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>:




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" 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>
 
 
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.
_________________________________________________________________
Got more than one Hotmail account? Save time by linking them together
 http://clk.atdmt.com/UKM/go/186394591/direct/01/