You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by afryer <ap...@hotmail.com> on 2011/06/21 08:16:04 UTC

Re: missing required persistence.xml (apache-tomee-tomcat-7.0.6-3.2-SNAPSHOT)

I've just come across this problem in the trunk build.  Hope this gets fixed
soon.

--
View this message in context: http://openejb.979440.n4.nabble.com/missing-required-persistence-xml-apache-tomee-tomcat-7-0-6-3-2-SNAPSHOT-tp3329814p3613276.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: missing required persistence.xml (apache-tomee-tomcat-7.0.6-3.2-SNAPSHOT)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi, can you provide a demo app?

- Romain

Le 22 juin 2011 02:40, "afryer" <ap...@hotmail.com> a écrit :
> I just did an svn update on the trunk and rebuilt tomee to make sure i had
> the latest changes. I'm still getting this problem. The error i'm seeing
> in openejb.log is....
>
> 2011-06-22 10:22:00,042 - ERROR - FAIL ... TournamentImpl: Missing
required
> persistence.xml for @PersistenceContext ref "entityManager" to unit
> "poker-entities"
>
> This looks to me like openejb is trying to create the Stateless session
ejb
> TournamentImpl but is failing because it can't inject the entityManager
> because it doesn't exist.
>
> I have structured my webapp such that my entity beans are contained in a
jar
> file (poker-entities.jar) and my stateless session ejbs are contained in
> another jar file (poker-ejbs.jar), both jars contained in the WEB-INF/lib
> folder of my web application (war file). In my poker-entities.jar file i
> have a persistence.xml file in the META-INF folder. It seems like openejb
> is not finding this persistence.xml in my jar file anymore or its finding
> the ejb jar first and trying to instantiate it before it got to the entity
> jar file. I say "anymore" because it used to work with an earlier version
> of openejb that i built from the trunk ages ago (around December or
> January). I tried renaming my jar files so the entity jar file would be
> first when ordered by name but it didn't make any difference.
>
> To work around this problem, i have to put a persistence.xml file in the
> META-INF folder of the web application war file and use the <jar-file>
> element in that persistence.xml to specify the
> WEB-INF/lib/poker-entities.jar. This works ok but is not ideal. I would
> like to be able to go back to having openejb automatically find the
> poker-entities.jar file in WEB-INF/lib and create the entity manager that
> way.
>
>
>
>
>
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/missing-required-persistence-xml-apache-tomee-tomcat-7-0-6-3-2-SNAPSHOT-tp3329814p3615730.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: missing required persistence.xml (apache-tomee-tomcat-7.0.6-3.2-SNAPSHOT)

Posted by afryer <ap...@hotmail.com>.
I just did an svn update on the trunk and rebuilt tomee to make sure i had
the latest changes.  I'm still getting this problem.  The error i'm seeing
in openejb.log is....

2011-06-22 10:22:00,042 - ERROR - FAIL ... TournamentImpl:	Missing required
persistence.xml for @PersistenceContext ref "entityManager" to unit
"poker-entities"

This looks to me like openejb is trying to create the Stateless session ejb
TournamentImpl but is failing because it can't inject the entityManager
because it doesn't exist.  

I have structured my webapp such that my entity beans are contained in a jar
file (poker-entities.jar) and my stateless session ejbs are contained in
another jar file (poker-ejbs.jar), both jars contained in the WEB-INF/lib
folder of my web application (war file).  In my poker-entities.jar file i
have a persistence.xml file in the META-INF folder.  It seems like openejb
is not finding this persistence.xml in my jar file anymore or its finding
the ejb jar first and trying to instantiate it before it got to the entity
jar file.  I say "anymore" because it used to work with an earlier version
of openejb that i built from the trunk ages ago (around December or
January).  I tried renaming my jar files so the entity jar file would be
first when ordered by name but it didn't make any difference.

To work around this problem, i have to put a persistence.xml file in the
META-INF folder of the web application war file and use the <jar-file>
element in that persistence.xml to specify the
WEB-INF/lib/poker-entities.jar.  This works ok but is not ideal.  I would
like to be able to go back to having openejb automatically find the
poker-entities.jar file in WEB-INF/lib and create the entity manager that
way.






--
View this message in context: http://openejb.979440.n4.nabble.com/missing-required-persistence-xml-apache-tomee-tomcat-7-0-6-3-2-SNAPSHOT-tp3329814p3615730.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: missing required persistence.xml (apache-tomee-tomcat-7.0.6-3.2-SNAPSHOT)

Posted by Jonathan Gallimore <jo...@gmail.com>.
I read back through the thread - sounds like when a standalone ejb jar is
being deployed from TomEE's webapp folder, we don't see the persistence.xml
file - does that sound right?

I just gave this a try - and I think its working for me... I've grabbed the
"movies-complete" example and changed the persistence.xml file to have a JPA
2 style XML header. I dropped that jar in my TomEE webapps directory and it
seems to deploy ok.

It could be I'm not doing the right thing to reproduce this - I've made a
few code changes in the last couple of days, so if you can give me a couple
of pointers I'll try and check it out and see what's going on.

Jon


On Tue, Jun 21, 2011 at 7:16 AM, afryer <ap...@hotmail.com> wrote:

> I've just come across this problem in the trunk build.  Hope this gets
> fixed
> soon.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/missing-required-persistence-xml-apache-tomee-tomcat-7-0-6-3-2-SNAPSHOT-tp3329814p3613276.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>