David,

thanks for your answer.
Actually the background for the ejb-jar.xml definition is as follows:
I´ve got a common project, that is used together with some other projects 
within different persistence-units.
Therefore the EntityManager is not bound to a specific persistenceUnit, but the 
annotation is simply left empty.
During the deployment (in my case in the ear, which is deployed to a JBoss AS) 
the binding of this specific EntityManager to a specific persistenceUnit is 
done.
During my tests with openEJB I run into the problem, that I have multiple 
persistence.xml on my classpath and therefore the EntityManager has to be bound 
to a specific persistenceUnit as well. Unfortunately I cannot bind it through 
your recommondation using the alternate DD, as the persistenceUnit changes with 
whatever project uses this common library and the EntityManager should join the 
project´s persistenceUnit.

Do you understand, what I mean?

@Jean-Louis: No - I have not tried it yet - this might be an idea. I´ll let you 
know as soon as I tested it.

Thomas

-----Ursprüngliche Nachricht-----
Von: David Blevins [mailto:david.blev...@visi.com]
Gesendet: Dienstag, 3. März 2009 04:26
An: users@openejb.apache.org
Betreff: Re: AW: Override PersistenceContext

On Feb 23, 2009, at 4:11 AM, <thomas.th.hamac...@partner.bmw.ch> 
<thomas.th.hamac...@partner.bmw.ch
 > wrote:

> So if I copy the CustomerManager2Impl into the same jar, everything
> works fine, but as soon as I copy this into another jar and reference
> this jar, the deployment does not work anymore.

Hmm.  The ejb-jar.xml has to be in the module.  I suspect that you have it 
outside the module because you don't want that particular ejb- jar.xml data to 
be picked up at runtime by the production ejb container.  If that's the case, 
some of the code we have in trunk might help.

There was a post about it a couple weeks ago.  I've taken that email and 
cleaned it up for you:

   http://cwiki.apache.org/OPENEJBx30/alternate-descriptors.html

If you use maven, there are 3.1.1 snapshots available here:

   http://people.apache.org/repo/m2-snapshot-repository/org/apache/openejb/

If you want an openejb.zip file I'd be happy to build one for you.

-David




Reply via email to