tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Gomez" <henri.go...@gmail.com>
Subject Re: persistence.xml in a Jar in Tomcat Common classloader (ERROR : PersistenceUnit already deployed)
Date Tue, 28 Oct 2008 09:08:31 GMT
> Could it be done for 3.1 release ?

Hi to all,

In the 3.1 release changelog I could see :

EAR-style classpath application discovery groups individual modules as
an EAR allowing sharing of persistence units and improved connector
and custom MDB deployment.

Did it what we discussed in this thread ?

If so, a big thanks to OpenEJB team !

>
> Thanks
>
> Le 16 oct. 08 à 12:13, Maxime Thieu <maxime.thieu@gmail.com> a écrit :
>
>>
>> Hi David,
>>
>> Thanks for your anwser.
>>
>> I allready try including persistence.xml in my webapp.
>> But this doesn't works because I have Service in service.jar with
>> Annotation
>> @PersistenceContext under EntityManager.
>> OpenEJB doesn't find it (because it's defined in the webapp) when it loads
>> service.jar :
>> ERROR - FAIL ... MyService:    Missing required persistence.xml for
>> @PersistenceContext ref "entityManager" to unit "jpa-service"
>>
>> Even if this has worked, it is not really what I'm after.
>>
>> Indeed, I will be very interested if "global" persistence units where
>> managed by OpenEJB.
>>
>> Thanks in advance,
>>
>> Maxime
>>
>>
>>
>> David Blevins wrote:
>>>
>>> Hi Maxime,
>>>
>>> It should be possible to put the service.jar in the Tomcat lib/
>>> directory without a persistence.xml in it and then include that
>>> persistence xml in your webapp.  You should be able to include a <jar-
>>> file> element in the unit declaration that points to the C:/tomcat6/
>>> lib/service.jar so all the entities will be discovered without having
>>> to explicitly list them via the <class> element.  You'd have to
>>> include the same persistence.xml in each webapp that wanted to reuse
>>> the classes in service.jar.
>>>
>>> Not entirely sure though if that's really what you're after.  We don't
>>> currently have any support for "global" persistence units.  Meaning
>>> say a persistence unit declared outside of an ear at server level and
>>> available to all ears/apps deployed.  It might be something we could
>>> add if that's really what you're after.
>>>
>>> -David
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/persistence.xml-in-a-Jar-in-Tomcat-Common-classloader-%28ERROR-%3A-PersistenceUnit-already-deployed%29-tp20008468p20010734.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>

Mime
View raw message