You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Laird Nelson <lj...@gmail.com> on 2009/08/19 03:12:14 UTC

LocalClient: application-client.xml trumps persistence.xml

I have a unit test that I'm trying to annotate and get rolling with the
@LocalClient annotation.

I have a provisional persistence.xml in that project, in
src/test/resources/META-INF, and an empty
src/test/resources/META-INF/application-client.xml file as well (to trigger
discovery).

Unfortunately, OpenEJB seems to decide that because the
application-client.xml file is there, the project is a Client Module, and so
doesn't recognize that it's also a Persistence Module.

If I remove the application-client.xml file, then the persistence.xml file
is discovered, but now my test class is not injected.

Thoughts?

Best,
Laird

Re: LocalClient: application-client.xml trumps persistence.xml

Posted by David Blevins <da...@visi.com>.
On Aug 18, 2009, at 6:12 PM, Laird Nelson wrote:

> I have a unit test that I'm trying to annotate and get rolling with  
> the
> @LocalClient annotation.
>
> I have a provisional persistence.xml in that project, in
> src/test/resources/META-INF, and an empty
> src/test/resources/META-INF/application-client.xml file as well (to  
> trigger
> discovery).
>
> Unfortunately, OpenEJB seems to decide that because the
> application-client.xml file is there, the project is a Client  
> Module, and so
> doesn't recognize that it's also a Persistence Module.
>
> If I remove the application-client.xml file, then the  
> persistence.xml file
> is discovered, but now my test class is not injected.

Both "ClientModules" and "EjbModules" can use the @LocalClient  
annotation.  Use an empty ejb-jar.xml instead of an empty application- 
client.xml and all should work with your persistence.xml.

-David