Apache Geronimo > Discussion Forums  User List | Dev List | Wiki | Issue Tracker  

Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

View: New views
11 Messages — Rating Filter:   Alert me  

Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by pookie1973 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm using Geronimo 2.1, I have an ear file containing an EJB project with a single stateless session bean and a JPA project containing four entity beans. When I export the ear file and deploy it to Geronimo via the console, I get:-

At least one deployment problem:[org.apache.geronimo.common.DeploymentException: Could not resolve reference at deploy time for query ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean. No GBean references found.]
org.apache.geronimo.common.DeploymentException: At least one deployment problem:[org.apache.geronimo.common.DeploymentException: Could not resolve reference at deploy time for query ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean. No GBean references found.]
        at org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
        at org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
        at org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
        at org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
        at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
        at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
        at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
        at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
        at java.lang.Thread.run(Unknown Source)

I searched the internet in order to see if anyone else encountered this issue. I found that Shawn (Jiang) responded to someone who had exactly the same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR package structure, here it is:-

Top level:-

META-INF/MANIFEST.MF
        /geronimo-application.xml
jpaFacadeClient.jar
jpaFacade.jar
jpaEntity.jar

If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I have:-

C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
    58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
     0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
   313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
     0 Tue Jun 23 22:08:26 BST 2009 META-INF/
  1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
  1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
     0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
     0 Tue Jun 23 22:12:06 BST 2009 com/
   686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
  1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
  2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class

Shawn also requested the EAR file, which I will attach. Previously I had attempted to deploy this directly to the app server from Eclipse and I wasn't getting as far as this. I posted a question to which Shawn responded, I did not reply to this as my second son was born on Monday, hence I was a tad proccupied with other things, so Shawn is you read this I wasn't blanking you out, but many thanks for responding my last question in such a prompt manner anyway.jpaTestEAR.ear

Re: Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by Shawn Jiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

To make Geronimo find the PU, I think the structure of your EAR should be like this:

META-INF/MANIFEST.MF
       /geronimo-application.xml
lib/jpaFacadeClient.jar
lib/jpaEntity.jar
jpaFacade.jar


I also saw a <jta-data-source>OracleDS</jta-data-source>  in your persistence.xml.  You should add this datasource module as a dependency in geronimo-application.xml

On Thu, Jun 25, 2009 at 4:05 AM, pookie1973 <christopher.adkin@...> wrote:

I'm using Geronimo 2.1, I have an ear file containing an EJB project with a
single stateless session bean and a JPA project containing four entity
beans. When I export the ear file and deploy it to Geronimo via the console,
I get:-

At least one deployment
problem:[org.apache.geronimo.common.DeploymentException: Could not resolve
reference at deploy time for query
?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
No GBean references found.]
org.apache.geronimo.common.DeploymentException: At least one deployment
problem:[org.apache.geronimo.common.DeploymentException: Could not resolve
reference at deploy time for query
?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
No GBean references found.]
       at
org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
       at
org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
       at
org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
       at
org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
       at
org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
       at
org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at
org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
       at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
       at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
       at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
       at
org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
       at
org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
       at java.lang.Thread.run(Unknown Source)

I searched the internet in order to see if anyone else encountered this
issue. I found that Shawn (Jiang) responded to someone who had exactly the
same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR package
structure, here it is:-

Top level:-

META-INF/MANIFEST.MF
       /geronimo-application.xml
jpaFacadeClient.jar
jpaFacade.jar
jpaEntity.jar

If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I have:-

C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
   58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
    0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
  313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
    0 Tue Jun 23 22:08:26 BST 2009 META-INF/
 1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
 1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
    0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
    0 Tue Jun 23 22:12:06 BST 2009 com/
  686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
 1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
 2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class

Shawn also requested the EAR file, which I will attach. Previously I had
attempted to deploy this directly to the app server from Eclipse and I
wasn't getting as far as this. I posted a question to which Shawn responded,
I did not reply to this as my second son was born on Monday, hence I was a
tad proccupied with other things, so Shawn is you read this I wasn't
blanking you out, but many thanks for responding my last question in such a
prompt manner anyway. http://www.nabble.com/file/p24191944/jpaTestEAR.ear
jpaTestEAR.ear
--
View this message in context: http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24191944.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.




--
Shawn
-Shawn

Re: Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by Shawn Jiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

En, you might also want to add a application.xml under EAR/META-INF/  with content like following:

<?xml version="1.0" encoding="UTF-8"?>
  <description>my EJB</description>
  <display-name>my EJB</display-name>
  <module>
    <ejb>jpaFacade.jar</ejb>
  </module>
</application>

On Thu, Jun 25, 2009 at 9:38 AM, Shawn Jiang <genspring@...> wrote:
To make Geronimo find the PU, I think the structure of your EAR should be like this:

META-INF/MANIFEST.MF
       /geronimo-application.xml
lib/jpaFacadeClient.jar
lib/jpaEntity.jar
jpaFacade.jar


I also saw a <jta-data-source>OracleDS</jta-data-source>  in your persistence.xml.  You should add this datasource module as a dependency in geronimo-application.xml


On Thu, Jun 25, 2009 at 4:05 AM, pookie1973 <christopher.adkin@...> wrote:

I'm using Geronimo 2.1, I have an ear file containing an EJB project with a
single stateless session bean and a JPA project containing four entity
beans. When I export the ear file and deploy it to Geronimo via the console,
I get:-

At least one deployment
problem:[org.apache.geronimo.common.DeploymentException: Could not resolve
reference at deploy time for query
?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
No GBean references found.]
org.apache.geronimo.common.DeploymentException: At least one deployment
problem:[org.apache.geronimo.common.DeploymentException: Could not resolve
reference at deploy time for query
?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
No GBean references found.]
       at
org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
       at
org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
       at
org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
       at
org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
       at
org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
       at
org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at
org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
       at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
       at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
       at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
       at
org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
       at
org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
       at java.lang.Thread.run(Unknown Source)

I searched the internet in order to see if anyone else encountered this
issue. I found that Shawn (Jiang) responded to someone who had exactly the
same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR package
structure, here it is:-

Top level:-

META-INF/MANIFEST.MF
       /geronimo-application.xml
jpaFacadeClient.jar
jpaFacade.jar
jpaEntity.jar

If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I have:-

C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
   58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
    0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
  313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
    0 Tue Jun 23 22:08:26 BST 2009 META-INF/
 1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
 1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
    0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
    0 Tue Jun 23 22:12:06 BST 2009 com/
  686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
 1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
 2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class

Shawn also requested the EAR file, which I will attach. Previously I had
attempted to deploy this directly to the app server from Eclipse and I
wasn't getting as far as this. I posted a question to which Shawn responded,
I did not reply to this as my second son was born on Monday, hence I was a
tad proccupied with other things, so Shawn is you read this I wasn't
blanking you out, but many thanks for responding my last question in such a
prompt manner anyway. http://www.nabble.com/file/p24191944/jpaTestEAR.ear
jpaTestEAR.ear
--
View this message in context: http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24191944.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.




--
Shawn



--
Shawn
-Shawn

Re: Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by pookie1973 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Shawn,

I've added the database pool as a dependancy to the geronimo-application.xml file and redeployed the app, this has made no difference. I wil try you other suggestion of creating the EAR file with a slightly different format as advised. Off the back of this I have two questions:-

1. Does the fact that I cannot deploy the EAR straight from Eclipse or export as EAR from Eclipe and then deploy it successfully mean there is some sort of Eclipse Geronimo tooling integration issue.

2. I noticed in the Eclipse screen wheer I added the server dependancy that I can also add GBeans, is the adding of GBeans something I need to concern myself with .

Regards,

Chris

Shawn Jiang wrote:
To make Geronimo find the PU, I think the structure of your EAR should be
like this:
META-INF/MANIFEST.MF
       /geronimo-application.xml
lib/jpaFacadeClient.jar
lib/jpaEntity.jar
jpaFacade.jar


I also saw a <jta-data-source>OracleDS</jta-data-source>  in your
persistence.xml.  You should add this datasource module as a dependency in
geronimo-application.xml

On Thu, Jun 25, 2009 at 4:05 AM, pookie1973 <christopher.adkin@nhs.net>wrote:

>
> I'm using Geronimo 2.1, I have an ear file containing an EJB project with a
> single stateless session bean and a JPA project containing four entity
> beans. When I export the ear file and deploy it to Geronimo via the
> console,
> I get:-
>
> At least one deployment
> problem:[org.apache.geronimo.common.DeploymentException: Could not resolve
> reference at deploy time for query
>
> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
> No GBean references found.]
> org.apache.geronimo.common.DeploymentException: At least one deployment
> problem:[org.apache.geronimo.common.DeploymentException: Could not resolve
> reference at deploy time for query
>
> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
> No GBean references found.]
>        at
>
> org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
>        at
>
> org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
>        at
>
> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
>        at
>
> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
>        at
>
> org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
>        at
>
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
>        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
>        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>        at java.lang.reflect.Method.invoke(Unknown Source)
>        at
>
> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
>        at
>
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
>        at
>
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
>        at
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
>        at
>
> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
>        at
>
> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
>        at java.lang.Thread.run(Unknown Source)
>
> I searched the internet in order to see if anyone else encountered this
> issue. I found that Shawn (Jiang) responded to someone who had exactly the
> same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR package
> structure, here it is:-
>
> Top level:-
>
> META-INF/MANIFEST.MF
>        /geronimo-application.xml
> jpaFacadeClient.jar
> jpaFacade.jar
> jpaEntity.jar
>
> If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I
> have:-
>
> C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
>    58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
>     0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
>   313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
>     0 Tue Jun 23 22:08:26 BST 2009 META-INF/
>  1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
>  1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
>     0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
>     0 Tue Jun 23 22:12:06 BST 2009 com/
>   686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
>  1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
>  2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class
>
> Shawn also requested the EAR file, which I will attach. Previously I had
> attempted to deploy this directly to the app server from Eclipse and I
> wasn't getting as far as this. I posted a question to which Shawn
> responded,
> I did not reply to this as my second son was born on Monday, hence I was a
> tad proccupied with other things, so Shawn is you read this I wasn't
> blanking you out, but many thanks for responding my last question in such a
> prompt manner anyway. http://www.nabble.com/file/p24191944/jpaTestEAR.ear
> jpaTestEAR.ear
> --
> View this message in context:
> http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24191944.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>


--
Shawn

Re: Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by Shawn Jiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Thu, Jun 25, 2009 at 8:51 PM, pookie1973 <christopher.adkin@...> wrote:

Shawn,

I've added the database pool as a dependancy to the geronimo-application.xml
file and redeployed the app, this has made no difference. I wil try you
other suggestion of creating the EAR file with a slightly different format
as advised. Off the back of this I have two questions:-

1. Does the fact that I cannot deploy the EAR straight from Eclipse or
export as EAR from Eclipe and then deploy it successfully mean there is some
sort of Eclipse Geronimo tooling integration issue.

Yes, the current document of geronimo JPA development use the same project for EJB and JPA.  So there's no classpath problem.  See:  http://cwiki.apache.org/GMOxDOC22/developing-container-managed-persistence-with-jpa.html#DevelopingcontainermanagedpersistencewithJPA-Creatingejbapplicationwithentities


If you need to separate JPA project from EJB project(your EAR demonstrate this case).  You have to make some configuration in WTP to make the JPA project in classpath of the EJB project.   Following is the instruction:

1, Right click your EJB project in WTP.
2, Java EE Module Dependencies  ---> select the jpa project as it's dependent jar. ---> click OK.
3, Export the EAR again, you could notice there's a 

Manifest-Version: 1.0
Class-Path: yourJPA.jar

in your EJB.jar/META-INF/MANIFEST.MF

In this way, Geronimo could find your JPA jar in classpath and parse the PU correctly if you have correct 

1, Datasource dependency in your geronimo-application.xml or your openejb-jar.xml.
2, Correct persistence.xml.

 


2. I noticed in the Eclipse screen wheer I added the server dependancy that
I can also add GBeans, is the adding of GBeans something I need to concern
myself with .


No, To develop EJB and JPA apps, you don't need to add GBean at all.  


Regards,

Chris


Shawn Jiang wrote:
>
> To make Geronimo find the PU, I think the structure of your EAR should be
> like this:
> META-INF/MANIFEST.MF
>        /geronimo-application.xml
> lib/jpaFacadeClient.jar
> lib/jpaEntity.jar
> jpaFacade.jar
>
>
> I also saw a <jta-data-source>OracleDS</jta-data-source>  in your
> persistence.xml.  You should add this datasource module as a dependency in
> geronimo-application.xml
>
> On Thu, Jun 25, 2009 at 4:05 AM, pookie1973
> <christopher.adkin@...>wrote:
>
>>
>> I'm using Geronimo 2.1, I have an ear file containing an EJB project with
>> a
>> single stateless session bean and a JPA project containing four entity
>> beans. When I export the ear file and deploy it to Geronimo via the
>> console,
>> I get:-
>>
>> At least one deployment
>> problem:[org.apache.geronimo.common.DeploymentException: Could not
>> resolve
>> reference at deploy time for query
>>
>> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
>> No GBean references found.]
>> org.apache.geronimo.common.DeploymentException: At least one deployment
>> problem:[org.apache.geronimo.common.DeploymentException: Could not
>> resolve
>> reference at deploy time for query
>>
>> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
>> No GBean references found.]
>>        at
>>
>> org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
>>        at
>>
>> org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
>>        at
>>
>> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
>>        at
>>
>> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
>>        at
>>
>> org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
>>        at
>>
>> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
>>        at
>> org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
>>        at
>> org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>        at java.lang.reflect.Method.invoke(Unknown Source)
>>        at
>>
>> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
>>        at
>>
>> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
>>        at
>>
>> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
>>        at
>> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
>>        at
>>
>> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
>>        at
>>
>> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
>>        at java.lang.Thread.run(Unknown Source)
>>
>> I searched the internet in order to see if anyone else encountered this
>> issue. I found that Shawn (Jiang) responded to someone who had exactly
>> the
>> same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR
>> package
>> structure, here it is:-
>>
>> Top level:-
>>
>> META-INF/MANIFEST.MF
>>        /geronimo-application.xml
>> jpaFacadeClient.jar
>> jpaFacade.jar
>> jpaEntity.jar
>>
>> If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I
>> have:-
>>
>> C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
>>    58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
>>     0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
>>   313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
>>     0 Tue Jun 23 22:08:26 BST 2009 META-INF/
>>  1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
>>  1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
>>     0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
>>     0 Tue Jun 23 22:12:06 BST 2009 com/
>>   686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
>>  1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
>>  2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class
>>
>> Shawn also requested the EAR file, which I will attach. Previously I had
>> attempted to deploy this directly to the app server from Eclipse and I
>> wasn't getting as far as this. I posted a question to which Shawn
>> responded,
>> I did not reply to this as my second son was born on Monday, hence I was
>> a
>> tad proccupied with other things, so Shawn is you read this I wasn't
>> blanking you out, but many thanks for responding my last question in such
>> a
>> prompt manner anyway. http://www.nabble.com/file/p24191944/jpaTestEAR.ear
>> jpaTestEAR.ear
>> --
>> View this message in context:
>> http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24191944.html
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>>
>
>
> --
> Shawn
>
>

--
View this message in context: http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24202670.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.




--
Shawn
-Shawn

Re: Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by pookie1973 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Shawn,

Many thanks for the update, I will try your new suggestions out and report back.

Kind regards,

Chris

Shawn Jiang wrote:
On Thu, Jun 25, 2009 at 8:51 PM, pookie1973 <christopher.adkin@nhs.net>wrote:

>
> Shawn,
>
> I've added the database pool as a dependancy to the
> geronimo-application.xml
> file and redeployed the app, this has made no difference. I wil try you
> other suggestion of creating the EAR file with a slightly different format
> as advised. Off the back of this I have two questions:-
>
> 1. Does the fact that I cannot deploy the EAR straight from Eclipse or
> export as EAR from Eclipe and then deploy it successfully mean there is
> some
> sort of Eclipse Geronimo tooling integration issue.


Yes, the current document of geronimo JPA development use the same project
for EJB and JPA.  So there's no classpath problem.  See:
http://cwiki.apache.org/GMOxDOC22/developing-container-managed-persistence-with-jpa.html#DevelopingcontainermanagedpersistencewithJPA-Creatingejbapplicationwithentities


If you need to separate JPA project from EJB project(your
EAR demonstrate this case).  You have to make some configuration in WTP to
make the JPA project in classpath of the EJB project.   Following is the
instruction:

1, Right click your EJB project in WTP.
2, Java EE Module Dependencies  ---> select the jpa project as it's
dependent jar. ---> click OK.
3, Export the EAR again, you could notice there's a

Manifest-Version: 1.0
Class-Path: yourJPA.jar


in your EJB.jar/META-INF/MANIFEST.MF


In this way, Geronimo could find your JPA jar in classpath and parse the PU
correctly if you have correct

1, Datasource dependency in your geronimo-application.xml or your
openejb-jar.xml.
2, Correct persistence.xml.




>
>
> 2. I noticed in the Eclipse screen wheer I added the server dependancy that
> I can also add GBeans, is the adding of GBeans something I need to concern
> myself with .



No, To develop EJB and JPA apps, you don't need to add GBean at all.

>
>
> Regards,
>
> Chris
>
>
> Shawn Jiang wrote:
> >
> > To make Geronimo find the PU, I think the structure of your EAR should be
> > like this:
> > META-INF/MANIFEST.MF
> >        /geronimo-application.xml
> > lib/jpaFacadeClient.jar
> > lib/jpaEntity.jar
> > jpaFacade.jar
> >
> >
> > I also saw a <jta-data-source>OracleDS</jta-data-source>  in your
> > persistence.xml.  You should add this datasource module as a dependency
> in
> > geronimo-application.xml
> >
> > On Thu, Jun 25, 2009 at 4:05 AM, pookie1973
> > <christopher.adkin@nhs.net>wrote:
> >
> >>
> >> I'm using Geronimo 2.1, I have an ear file containing an EJB project
> with
> >> a
> >> single stateless session bean and a JPA project containing four entity
> >> beans. When I export the ear file and deploy it to Geronimo via the
> >> console,
> >> I get:-
> >>
> >> At least one deployment
> >> problem:[org.apache.geronimo.common.DeploymentException: Could not
> >> resolve
> >> reference at deploy time for query
> >>
> >>
> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
> >> No GBean references found.]
> >> org.apache.geronimo.common.DeploymentException: At least one deployment
> >> problem:[org.apache.geronimo.common.DeploymentException: Could not
> >> resolve
> >> reference at deploy time for query
> >>
> >>
> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
> >> No GBean references found.]
> >>        at
> >>
> >>
> org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
> >>        at
> >>
> >>
> org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
> >>        at
> >>
> >>
> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
> >>        at
> >>
> >>
> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
> >>        at
> >>
> >>
> org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
> >>        at
> >>
> >>
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
> >>        at
> >> org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
> >>        at
> >> org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> >>        at java.lang.reflect.Method.invoke(Unknown Source)
> >>        at
> >>
> >>
> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
> >>        at
> >>
> >>
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
> >>        at
> >>
> >>
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
> >>        at
> >>
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
> >>        at
> >>
> >>
> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
> >>        at
> >>
> >>
> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
> >>        at java.lang.Thread.run(Unknown Source)
> >>
> >> I searched the internet in order to see if anyone else encountered this
> >> issue. I found that Shawn (Jiang) responded to someone who had exactly
> >> the
> >> same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR
> >> package
> >> structure, here it is:-
> >>
> >> Top level:-
> >>
> >> META-INF/MANIFEST.MF
> >>        /geronimo-application.xml
> >> jpaFacadeClient.jar
> >> jpaFacade.jar
> >> jpaEntity.jar
> >>
> >> If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I
> >> have:-
> >>
> >> C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
> >>    58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
> >>     0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
> >>   313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
> >>     0 Tue Jun 23 22:08:26 BST 2009 META-INF/
> >>  1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
> >>  1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
> >>     0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
> >>     0 Tue Jun 23 22:12:06 BST 2009 com/
> >>   686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
> >>  1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
> >>  2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class
> >>
> >> Shawn also requested the EAR file, which I will attach. Previously I had
> >> attempted to deploy this directly to the app server from Eclipse and I
> >> wasn't getting as far as this. I posted a question to which Shawn
> >> responded,
> >> I did not reply to this as my second son was born on Monday, hence I was
> >> a
> >> tad proccupied with other things, so Shawn is you read this I wasn't
> >> blanking you out, but many thanks for responding my last question in
> such
> >> a
> >> prompt manner anyway.
> http://www.nabble.com/file/p24191944/jpaTestEAR.ear
> >> jpaTestEAR.ear
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24191944.html
> >> Sent from the Apache Geronimo - Users mailing list archive at
> Nabble.com.
> >>
> >>
> >
> >
> > --
> > Shawn
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24202670.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>


--
Shawn

Re: Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by pookie1973 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Shawn,

I added the module dependancy in Eclipse as advised and this has rectified the issue persistence GBean. However, I have now run into another issue when deploying, namely:-

Unable to resolve reference "JtaDataSourceWrapper"
    in gbean default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
    to a gbean matching the pattern [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
    due to: No matches for referencePatterns: [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
org.apache.geronimo.common.DeploymentException: Unable to resolve reference "JtaDataSourceWrapper"
    in gbean default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
    to a gbean matching the pattern [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
    due to: No matches for referencePatterns: [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
        at org.apache.geronimo.deployment.DeploymentContext.getConfigurationData(DeploymentContext.java:672)
        at org.apache.geronimo.deployment.Deployer.install(Deployer.java:332)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:256)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
        at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
        at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
        at java.lang.Thread.run(Unknown Source)

It appears that other people have run into this issue, but I'm unable to glean any useful information as to what the resolution to this is. Other people that have reported this to forums and mailing groups have been advised to:-

1. Make sure that the data source specificied in the persistence.xml is actaully set up in the app server, in my case the data source is set up on the app server.

2. The data source is listed as an application dependancy, I have already done this.

Thanks for all your help so far, please advise as to how I can get past this latest issue.

Regards,

Chris



pookie1973 wrote:
I'm using Geronimo 2.1, I have an ear file containing an EJB project with a single stateless session bean and a JPA project containing four entity beans. When I export the ear file and deploy it to Geronimo via the console, I get:-

At least one deployment problem:[org.apache.geronimo.common.DeploymentException: Could not resolve reference at deploy time for query ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean. No GBean references found.]
org.apache.geronimo.common.DeploymentException: At least one deployment problem:[org.apache.geronimo.common.DeploymentException: Could not resolve reference at deploy time for query ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean. No GBean references found.]
        at org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
        at org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
        at org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
        at org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
        at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
        at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
        at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
        at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
        at java.lang.Thread.run(Unknown Source)

I searched the internet in order to see if anyone else encountered this issue. I found that Shawn (Jiang) responded to someone who had exactly the same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR package structure, here it is:-

Top level:-

META-INF/MANIFEST.MF
        /geronimo-application.xml
jpaFacadeClient.jar
jpaFacade.jar
jpaEntity.jar

If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I have:-

C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
    58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
     0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
   313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
     0 Tue Jun 23 22:08:26 BST 2009 META-INF/
  1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
  1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
     0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
     0 Tue Jun 23 22:12:06 BST 2009 com/
   686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
  1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
  2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class

Shawn also requested the EAR file, which I will attach. Previously I had attempted to deploy this directly to the app server from Eclipse and I wasn't getting as far as this. I posted a question to which Shawn responded, I did not reply to this as my second son was born on Monday, hence I was a tad proccupied with other things, so Shawn is you read this I wasn't blanking you out, but many thanks for responding my last question in such a prompt manner anyway.jpaTestEAR.ear

Re: Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by Shawn Jiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have to add both JTA and NON-JTA datasource in persistence.xml when I deployed JPA with derby(IIRC). I don't know if deploying JPA with Oracle should do the same.

See how to add NON-JTA datasource here and give it a try.  



On Sun, Jun 28, 2009 at 3:48 AM, pookie1973 <christopher.adkin@...> wrote:

Shawn,

I added the module dependancy in Eclipse as advised and this has rectified
the issue persistence GBean. However, I have now run into another issue when
deploying, namely:-

Unable to resolve reference "JtaDataSourceWrapper"
   in gbean
default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
   to a gbean matching the pattern
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
   due to: No matches for referencePatterns:
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
org.apache.geronimo.common.DeploymentException: Unable to resolve reference
"JtaDataSourceWrapper"
   in gbean
default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
   to a gbean matching the pattern
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
   due to: No matches for referencePatterns:
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
       at
org.apache.geronimo.deployment.DeploymentContext.getConfigurationData(DeploymentContext.java:672)
       at org.apache.geronimo.deployment.Deployer.install(Deployer.java:332)
       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:256)
       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at
org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
       at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
       at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
       at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
       at
org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
       at
org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
       at java.lang.Thread.run(Unknown Source)

It appears that other people have run into this issue, but I'm unable to
glean any useful information as to what the resolution to this is. Other
people that have reported this to forums and mailing groups have been
advised to:-

1. Make sure that the data source specificied in the persistence.xml is
actaully set up in the app server, in my case the data source is set up on
the app server.

2. The data source is listed as an application dependancy, I have already
done this.

Thanks for all your help so far, please advise as to how I can get past this
latest issue.

Regards,

Chris




pookie1973 wrote:
>
> I'm using Geronimo 2.1, I have an ear file containing an EJB project with
> a single stateless session bean and a JPA project containing four entity
> beans. When I export the ear file and deploy it to Geronimo via the
> console, I get:-
>
> At least one deployment
> problem:[org.apache.geronimo.common.DeploymentException: Could not resolve
> reference at deploy time for query
> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
> No GBean references found.]
> org.apache.geronimo.common.DeploymentException: At least one deployment
> problem:[org.apache.geronimo.common.DeploymentException: Could not resolve
> reference at deploy time for query
> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
> No GBean references found.]
>       at
> org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
>       at
> org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
>       at
> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
>       at
> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
>       at
> org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
>       at
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
>       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
>       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>       at java.lang.reflect.Method.invoke(Unknown Source)
>       at
> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
>       at
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
>       at
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
>       at
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
>       at
> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
>       at
> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
>       at java.lang.Thread.run(Unknown Source)
>
> I searched the internet in order to see if anyone else encountered this
> issue. I found that Shawn (Jiang) responded to someone who had exactly the
> same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR
> package structure, here it is:-
>
> Top level:-
>
> META-INF/MANIFEST.MF
>         /geronimo-application.xml
> jpaFacadeClient.jar
> jpaFacade.jar
> jpaEntity.jar
>
> If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I
> have:-
>
> C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
>     58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
>      0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
>    313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
>      0 Tue Jun 23 22:08:26 BST 2009 META-INF/
>   1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
>   1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
>      0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
>      0 Tue Jun 23 22:12:06 BST 2009 com/
>    686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
>   1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
>   2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class
>
> Shawn also requested the EAR file, which I will attach. Previously I had
> attempted to deploy this directly to the app server from Eclipse and I
> wasn't getting as far as this. I posted a question to which Shawn
> responded, I did not reply to this as my second son was born on Monday,
> hence I was a tad proccupied with other things, so Shawn is you read this
> I wasn't blanking you out, but many thanks for responding my last question
> in such a prompt manner anyway.
> http://www.nabble.com/file/p24191944/jpaTestEAR.ear jpaTestEAR.ear
>

--
View this message in context: http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24236094.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.




--
Shawn
-Shawn

Re: Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by pookie1973 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Shawn,

I've added a none JTA data source to the persistence.xml, and changed the transaction type to resource local, I now get:-

Unable to resolve reference "NonJtaDataSourceWrapper"
    in gbean default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
    to a gbean matching the pattern [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
    due to: No matches for referencePatterns: [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
Unable to resolve reference "JtaDataSourceWrapper"
    in gbean default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
    to a gbean matching the pattern [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
    due to: No matches for referencePatterns: [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
org.apache.geronimo.common.DeploymentException: Unable to resolve reference "NonJtaDataSourceWrapper"
    in gbean default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
    to a gbean matching the pattern [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
    due to: No matches for referencePatterns: [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
Unable to resolve reference "JtaDataSourceWrapper"
    in gbean default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
    to a gbean matching the pattern [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
    due to: No matches for referencePatterns: [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
        at org.apache.geronimo.deployment.DeploymentContext.getConfigurationData(DeploymentContext.java:672)
        at org.apache.geronimo.deployment.Deployer.install(Deployer.java:332)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:256)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
        at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
        at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
        at java.lang.Thread.run(Unknown Source)

My understanding of a JTA data source is that it supports distributed transactions (XA) and that a none JTA data source only supports local transactions. I'm using the Oracle thin driver which supports both JTA and none JTA transactions, therefore I have specified the same data source for both transaction types.

Please advise.

Regards,

Chris

http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24238070.html

pookie1973 wrote:
I'm using Geronimo 2.1, I have an ear file containing an EJB project with a single stateless session bean and a JPA project containing four entity beans. When I export the ear file and deploy it to Geronimo via the console, I get:-

At least one deployment problem:[org.apache.geronimo.common.DeploymentException: Could not resolve reference at deploy time for query ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean. No GBean references found.]
org.apache.geronimo.common.DeploymentException: At least one deployment problem:[org.apache.geronimo.common.DeploymentException: Could not resolve reference at deploy time for query ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean. No GBean references found.]
        at org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
        at org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
        at org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
        at org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
        at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
        at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
        at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
        at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
        at java.lang.Thread.run(Unknown Source)

I searched the internet in order to see if anyone else encountered this issue. I found that Shawn (Jiang) responded to someone who had exactly the same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR package structure, here it is:-

Top level:-

META-INF/MANIFEST.MF
        /geronimo-application.xml
jpaFacadeClient.jar
jpaFacade.jar
jpaEntity.jar

If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I have:-

C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
    58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
     0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
   313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
     0 Tue Jun 23 22:08:26 BST 2009 META-INF/
  1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
  1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
     0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
     0 Tue Jun 23 22:12:06 BST 2009 com/
   686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
  1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
  2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class

Shawn also requested the EAR file, which I will attach. Previously I had attempted to deploy this directly to the app server from Eclipse and I wasn't getting as far as this. I posted a question to which Shawn responded, I did not reply to this as my second son was born on Monday, hence I was a tad proccupied with other things, so Shawn is you read this I wasn't blanking you out, but many thanks for responding my last question in such a prompt manner anyway.jpaTestEAR.ear

Re: Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by Shawn Jiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm not sure because I never used Oracle with Geronimo before.

Can you please create a standalone NonJta instead of reusing the JTA as the Non-JTA ?

Note: There is no way to create a single module that contains both JTA and Non-JTA DS with console wizard.  See: [1], You need to use the database pool wizard again to create another module for Non-JTA. and add this module as a dependency just like the JTA module.

[1] https://issues.apache.org/jira/browse/GERONIMO-4331

On Fri, Jul 3, 2009 at 6:16 AM, pookie1973 <christopher.adkin@...> wrote:

Shawn,

I've added a none JTA data source to the persistence.xml, and changed the
transaction type to resource local, I now get:-

Unable to resolve reference "NonJtaDataSourceWrapper"
   in gbean
default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
   to a gbean matching the pattern
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
   due to: No matches for referencePatterns:
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
Unable to resolve reference "JtaDataSourceWrapper"
   in gbean
default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
   to a gbean matching the pattern
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
   due to: No matches for referencePatterns:
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
org.apache.geronimo.common.DeploymentException: Unable to resolve reference
"NonJtaDataSourceWrapper"
   in gbean
default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
   to a gbean matching the pattern
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
   due to: No matches for referencePatterns:
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
Unable to resolve reference "JtaDataSourceWrapper"
   in gbean
default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
   to a gbean matching the pattern
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
   due to: No matches for referencePatterns:
[?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
       at
org.apache.geronimo.deployment.DeploymentContext.getConfigurationData(DeploymentContext.java:672)
       at org.apache.geronimo.deployment.Deployer.install(Deployer.java:332)
       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:256)
       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at
org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
       at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
       at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
       at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
       at
org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
       at
org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
       at java.lang.Thread.run(Unknown Source)

My understanding of a JTA data source is that it supports distributed
transactions (XA) and that a none JTA data source only supports local
transactions. I'm using the Oracle thin driver which supports both JTA and
none JTA transactions, therefore I have specified the same data source for
both transaction types.

Please advise.

Regards,

Chris

http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24238070.html


pookie1973 wrote:
>
> I'm using Geronimo 2.1, I have an ear file containing an EJB project with
> a single stateless session bean and a JPA project containing four entity
> beans. When I export the ear file and deploy it to Geronimo via the
> console, I get:-
>
> At least one deployment
> problem:[org.apache.geronimo.common.DeploymentException: Could not resolve
> reference at deploy time for query
> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
> No GBean references found.]
> org.apache.geronimo.common.DeploymentException: At least one deployment
> problem:[org.apache.geronimo.common.DeploymentException: Could not resolve
> reference at deploy time for query
> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
> No GBean references found.]
>       at
> org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
>       at
> org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
>       at
> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
>       at
> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
>       at
> org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
>       at
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
>       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
>       at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>       at java.lang.reflect.Method.invoke(Unknown Source)
>       at
> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
>       at
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
>       at
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
>       at
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
>       at
> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
>       at
> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
>       at java.lang.Thread.run(Unknown Source)
>
> I searched the internet in order to see if anyone else encountered this
> issue. I found that Shawn (Jiang) responded to someone who had exactly the
> same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR
> package structure, here it is:-
>
> Top level:-
>
> META-INF/MANIFEST.MF
>         /geronimo-application.xml
> jpaFacadeClient.jar
> jpaFacade.jar
> jpaEntity.jar
>
> If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I
> have:-
>
> C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
>     58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
>      0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
>    313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
>      0 Tue Jun 23 22:08:26 BST 2009 META-INF/
>   1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
>   1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
>      0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
>      0 Tue Jun 23 22:12:06 BST 2009 com/
>    686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
>   1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
>   2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class
>
> Shawn also requested the EAR file, which I will attach. Previously I had
> attempted to deploy this directly to the app server from Eclipse and I
> wasn't getting as far as this. I posted a question to which Shawn
> responded, I did not reply to this as my second son was born on Monday,
> hence I was a tad proccupied with other things, so Shawn is you read this
> I wasn't blanking you out, but many thanks for responding my last question
> in such a prompt manner anyway.
> http://www.nabble.com/file/p24191944/jpaTestEAR.ear jpaTestEAR.ear
>

--
View this message in context: http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24314829.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.




--
Shawn
-Shawn

Re: Could not resolve reference for persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean

by pookie1973 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Shawn,

I now have a JTA and none JTA data source set up in Geronimo, both are present in the persistence.xml and both are declared as dependencies in my geronimo-application.xml file. I suspect that the issue I have is something to do with my project set up or the way that the data sources have been deployed to Geronimo and not necessarily to do with the type of driver as such. Do you have any more suggestions ?. I looked at the article you gave me a link to, are the deployment plans for data sources somewhere under repository/console/dbpool ?.

Regards,

Chris

Shawn Jiang wrote:
I have to add both JTA and NON-JTA datasource in persistence.xml when I
deployed JPA with derby(IIRC). I don't know if deploying JPA with Oracle
should do the same.
See how to add NON-JTA datasource here and give it a try.

http://cwiki.apache.org/confluence/display/GMOxDOC22/persistence.xml#persistence.xml-%3Cjtadatasource%3E%2C%3Cnonjtadatasource%3E

<http://cwiki.apache.org/confluence/display/GMOxDOC22/persistence.xml#persistence.xml-%3Cjtadatasource%3E%2C%3Cnonjtadatasource%3E>
On Sun, Jun 28, 2009 at 3:48 AM, pookie1973 <christopher.adkin@nhs.net>wrote:

>
> Shawn,
>
> I added the module dependancy in Eclipse as advised and this has rectified
> the issue persistence GBean. However, I have now run into another issue
> when
> deploying, namely:-
>
> Unable to resolve reference "JtaDataSourceWrapper"
>    in gbean
>
> default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
>    to a gbean matching the pattern
> [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
>    due to: No matches for referencePatterns:
> [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
> org.apache.geronimo.common.DeploymentException: Unable to resolve reference
> "JtaDataSourceWrapper"
>    in gbean
>
> default/jpaTest/1.0/car?EJBModule=jpaFacade.jar,J2EEApplication=default/jpaTest/1.0/car,PersistenceUnitModule=jpaEntity.jar,j2eeType=PersistenceUnit,name=jpaEntity
>    to a gbean matching the pattern
> [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
>    due to: No matches for referencePatterns:
> [?name=OracleDS#org.apache.geronimo.naming.ResourceSource]
>        at
>
> org.apache.geronimo.deployment.DeploymentContext.getConfigurationData(DeploymentContext.java:672)
>        at
> org.apache.geronimo.deployment.Deployer.install(Deployer.java:332)
>        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:256)
>         at
> org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>        at java.lang.reflect.Method.invoke(Unknown Source)
>        at
>
> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
>        at
>
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
>        at
>
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
>        at
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
>        at
>
> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
>        at
>
> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
>        at java.lang.Thread.run(Unknown Source)
>
> It appears that other people have run into this issue, but I'm unable to
> glean any useful information as to what the resolution to this is. Other
> people that have reported this to forums and mailing groups have been
> advised to:-
>
> 1. Make sure that the data source specificied in the persistence.xml is
> actaully set up in the app server, in my case the data source is set up on
> the app server.
>
> 2. The data source is listed as an application dependancy, I have already
> done this.
>
> Thanks for all your help so far, please advise as to how I can get past
> this
> latest issue.
>
> Regards,
>
> Chris
>
>
>
>
> pookie1973 wrote:
> >
> > I'm using Geronimo 2.1, I have an ear file containing an EJB project with
> > a single stateless session bean and a JPA project containing four entity
> > beans. When I export the ear file and deploy it to Geronimo via the
> > console, I get:-
> >
> > At least one deployment
> > problem:[org.apache.geronimo.common.DeploymentException: Could not
> resolve
> > reference at deploy time for query
> >
> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
> > No GBean references found.]
> > org.apache.geronimo.common.DeploymentException: At least one deployment
> > problem:[org.apache.geronimo.common.DeploymentException: Could not
> resolve
> > reference at deploy time for query
> >
> ?name=persistence/jpaEntity#org.apache.geronimo.persistence.PersistenceUnitGBean.
> > No GBean references found.]
> >       at
> >
> org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder.buildNaming(PersistenceUnitRefBuilder.java:154)
> >       at
> >
> org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
> >       at
> >
> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.addEnc(EjbDeploymentBuilder.java:329)
> >       at
> >
> org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.buildEnc(EjbDeploymentBuilder.java:294)
> >       at
> >
> org.apache.geronimo.openejb.deployment.EjbModuleBuilder.addGBeans(EjbModuleBuilder.java:764)
> >       at
> >
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
> >       at
> org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:254)
> >       at
> org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
> >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >       at java.lang.reflect.Method.invoke(Unknown Source)
> >       at
> >
> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
> >       at
> >
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
> >       at
> >
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
> >       at
> > org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
> >       at
> >
> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
> >       at
> >
> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
> >       at java.lang.Thread.run(Unknown Source)
> >
> > I searched the internet in order to see if anyone else encountered this
> > issue. I found that Shawn (Jiang) responded to someone who had exactly
> the
> > same issue as myself on IBM DeveloperWorks. Shawn asked for the EAR
> > package structure, here it is:-
> >
> > Top level:-
> >
> > META-INF/MANIFEST.MF
> >         /geronimo-application.xml
> > jpaFacadeClient.jar
> > jpaFacade.jar
> > jpaEntity.jar
> >
> > If I unzip the ear file and run a jar tvf on the jpaEntity.jar file I
> > have:-
> >
> > C:\jpaTestEAR\jpaEntity>jar tvf jpaEntity.jar
> >     58 Wed Jun 24 12:31:06 BST 2009 META-INF/MANIFEST.MF
> >      0 Tue Jun 23 22:12:06 BST 2009 com/jpaEntity/
> >    313 Tue Jun 23 22:08:26 BST 2009 META-INF/orm.xml
> >      0 Tue Jun 23 22:08:26 BST 2009 META-INF/
> >   1654 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Dept.class
> >   1353 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Bonus.class
> >      0 Tue Jun 23 22:12:42 BST 2009 com/jpaEntity/test/
> >      0 Tue Jun 23 22:12:06 BST 2009 com/
> >    686 Wed Jun 24 13:52:16 BST 2009 META-INF/persistence.xml
> >   1124 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Salgrade.class
> >   2702 Wed Jun 24 14:00:16 BST 2009 com/jpaEntity/test/Emp.class
> >
> > Shawn also requested the EAR file, which I will attach. Previously I had
> > attempted to deploy this directly to the app server from Eclipse and I
> > wasn't getting as far as this. I posted a question to which Shawn
> > responded, I did not reply to this as my second son was born on Monday,
> > hence I was a tad proccupied with other things, so Shawn is you read this
> > I wasn't blanking you out, but many thanks for responding my last
> question
> > in such a prompt manner anyway.
> > http://www.nabble.com/file/p24191944/jpaTestEAR.ear jpaTestEAR.ear
> >
>
> --
> View this message in context:
> http://www.nabble.com/Could-not-resolve-reference-for-persistence-jpaEntity-org.apache.geronimo.persistence.PersistenceUnitGBean-tp24191944s134p24236094.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>


--
Shawn


-----
-Shawn