users@glassfish.java.net

Re: Correct packaging for EJBs in WAR or EAR.

From: Sahoo <sahoo_at_sun.com>
Date: Fri, 23 Apr 2010 12:53:24 +0530

glassfish_at_javadesktop.org wrote:
> Thanks for the suggestions guys. They gave me enough ideas that I should be able to get things set up to my liking. Creating a dedicated module for persistence.xml seems to give some extra packaging flexibility.
>
> However, I now realize I'm confused about a more basic issue. With JavaEE 6, where is persistence.xml supposed to get put? I used to keep it in the module with my JPA entities. However, I was having trouble with the persistence unit not getting recognized and moved persistence.xml into my EJB module. See here:
>
> http://forums.java.net/jive/thread.jspa?threadID=78910
>
> Today I moved persistence.xml back into the (dedicated) POJO module with my JPA entities and it worked the way I originally expected. I'm starting to think that moving persistence.xml into my EJB module was a mistake. My EJB module has no JPA entities. They are all in the dedicated POJO module.
>
This is the preferred way to package. We talked about it four years back!!!

http://weblogs.java.net/blog/ss141213/archive/2005/12/using_java_pers.html

Thanks,
Sahoo