users@glassfish.java.net

RE: Persistence unit ref:

From: Eve Pokua <gorgeous65_at_msn.com>
Date: Fri, 1 Jan 2010 21:41:26 +0000

Vince,

 

I created a java lib proj as follows-

 

1. New project in netbeans

2. chose java class library under project of java categories

3. created a META-INF folder in the src and cut the persistence.xml file

and pasted it into it.

4. Back to my project - right clicked my project ejb module/properties,

libraries, add library, Create, enter library name, Add Jar / Folder.

5. Added project created in step 2.

 

Repeated to for my war module.

 

I get the following error-

 

 

deployment started : 0%
Deploying application in domain failed; Could not resolve a
persistence unit corresponding to the persistence-context-ref-name
[entityJB.DeliveryBean/em] in the scope of the module called
[gfdeploy#C:\jee\KAKENTERPRISE\dist\gfdeploy\KAKENTERPRISE-ejb_jar]. Please verify your application.
C:\jee\KAKENTERPRISE\nbproject\build-impl.xml:275: The module has not been deployed.
BUILD FAILED (total time: 49 seconds)


 

On verification -

 

Fail For every entity manager referenced in the application,
there must be a matching persistence unit defined using META-INF/persistence.xml file.
Please refer to EJB 3.0 Persistence API Specification section #6.2 for further information.
For [ KAKENTERPRISE#KAKENTERPRISE-ejb.jar#BaleBean ]
There is no unique persistence unit found by name [ null ] in the scope of this component.
Persistence units that are visible to this component are [ ].


 

BUT

 

WHEN I copy my persistence.xml file into my src/conf of both

my ejb and war module it deploys.

 

I'm I on the right track by doing this. If not where I'm I going wrong in

the above?

 

Thanks

 

eve

 

 

 

 
> Date: Wed, 9 Dec 2009 07:57:36 -0800
> From: Vince.Kraemer_at_Sun.COM
> To: users_at_glassfish.dev.java.net
> Subject: Re: Persistence unit ref:
>
> Hmmm.
>
> I won't have time to do that for at least a couple days. I have a
> couple NB issues that require plugin code changes to resolve that have
> to take priority over helping someone restructure their app to resolve a
> Spring related issue.
>
> I think you will need to:
>
> I think you may be able to just;
> 1. create a Java Library project, then
> 2. create a META-INF folder in the Source Packages, then
> 3. Cut/Paste the persistence.xml file from the old ejb jar project into
> the project created at step 1...
> 4. Make the EJB and WEB app projects depenent on the JAR, using the
> project properties...
> 5. Deploy.
>
> vbk
>
> Eve Pokua wrote:
> > Vince,
> >
> > I need to add the per-unit-ref to my web.xml to make something in my
> > spring work. I already know it deploys if I comment it out. If you
> > could
> > get the application to deploy by doing below without commenting the
> > per-unit-ref out.
> > Please, attach it and I will deploy it.
> >
> > Thanks
> >
> > eve
> >
> > /------- Additional comments from mm110999
> > <mailto:mm110999_at_dev.java.net> Wed Dec 9 00:36:18 +0000 2009 -------/
> > The PU defined at ejb-jar level is not visible to war. See section 6.2.2 of JSR
> > 220 specs for more details. If you want to share a PU between two components of
> > and ear, the best place to put it is under lib dir of the ear like as follows
> >
> > my.ear
> > my.war
> > my.ejb.jar
> > lib/mypu.jar
> > META-INF/persitence.xml
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
                                               
_________________________________________________________________
Use Hotmail to send and receive mail from your different email accounts
http://clk.atdmt.com/UKM/go/186394592/direct/01/