Ok, I've found the problem:

Using EJB bean for Locator implementation isn't good, because GWT
instantiate it, so we have to make a EntityLocator, which lookups for the
EJB and invoke the right methods. I hope this helps to the others!

2011/2/2 Bálint Kriván <[email protected]>

> Hi!
>
> Did anybody tried to use RequestFactory with EJB Beans using
> Locator/ServiceLocator?
>
> I'm having a little issue here.
>
> My stateless session bean extends Locator<Group, Long>. For my
> RequestContext I use a ServiceLocator which uses InitialContext.doLookup();
> to lookup the EJB (I can't use @EJB because the ServiceLocator instance
> isn't container-managed -- btw. is there any solution for this? lookup looks
> ugly). Everything looks fine, but in my Bean, the entityManager instance is
> null (I'm using @PersistenceContext annotation on it) when GWT wants to
> invoke find(Class<?>, Long) method: here I use simple em.find(). It's
> strange because invoking from a servlet, using @EJB, it works fine. What am
> I doing wrong?
>
> I've created a gist for it: https://gist.github.com/807082
>
> So in this file: https://gist.github.com/807082#file_group_manager.java Line
> #29, the em is null, but using this servlet:
> https://gist.github.com/807082#file_test_servlet.java it works perfectly.
>
> Has anybody experience with this problem? I would like to use EJBs, because
> I would like to have JTA and Container-managed transactions. Thanks for any
> advice!
>
> --
> Regards,
> Bálint Kriván
>



-- 
Üdv,
Kriván Bálint

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to