users@glassfish.java.net

Re: CDI broken between EJB and JPA modules

From: Sahoo <Sahoo_at_sun.com>
Date: Fri, 09 Apr 2010 00:52:16 +0530

glassfish_at_javadesktop.org wrote:
> Sahoo,
>
> You rock! : ) You hit the nail on the head. As soon as I added a duplicate @PersistenceContext to my EJB, the @PersistenceContext in my DaoImpl started working.
>
> I'm disappointed that I didn't think to try that myself.
Don't be. That needed knowledge of internal details of GlassFish
deployment process.
> I think I've been staring at this stuff too long. : ) I'll go ahead and open a GF bug for this issue.
>
> One other question for you:
>
>
>> The ear you have attached has separate jar with JPA
>> classes and EJB
>> classes. I don't think that would work. So, first you
>> need to merge
>> JPA.jar with EJB.jar.
>>
>
> Why is that? I've read in so many different places how it's recommended to put JPA entities (along with Repository or Dao interfaces) into their own separate module, especially if multiple other modules (WAR, EJB, etc.) will need to use those entities. Why does CDI not support this recommended packaging structure?
>
Don't call JPA.jar a module. There are only four module types in Java
EE: ejb, web, appclient and rar. JPA.jar is a library jar, so if you
place it in lib directory of ear file, things should work as well.

Sahoo
> Thanks,
> -Dan
> [Message sent by forum member 'theodan']
>
> http://forums.java.net/jive/thread.jspa?messageID=395993
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>