This is with 1.0.1. Haven't tried @Intercept(ALWAYS) yet. Raja, what do you
mean you modified the registration app to do this? That app, in 1.0.1, has no
application-scoped components at all. What changes did you make and what
components did you add?
View the original post :
I modified the registration app not to work with EJBs but as Simple beans. The
other changes are to make the REgisterAction bean as a Application scope bean
and be available at Startup. I did those modifications just to make sure that
your original problem description was happening for me too.
Is this using current Seam CVS, or 1.0.1?
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3967933#3967933
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3967933
___
jboss-user
Maybe it's because of the phase. Injection by default only takes part when
beginning the INVOKE_APPLICATION phase. I think the init() method gets called
before the injection and so the EntityManager is null.
Try to annotate the bean with @Intercept(ALWAYS).
View the original post :
Hm. Well, I tried making it a @Stateful bean, and went through some rigmarole
with needing to put the init() method in the local interface.
But it still fails. I now get this (sorry for the big mangled stacktrace, this
forum isn't kind to long code lines):
[testng] WARN 25-08 00:41:39,828
Well well well. Some random forum surfing and one more try, and now this works:
/**
| * Local interface to replog.
| * TODO: do we really want this??? are we getting into a synchronization
mess?!?!?!?! or is it Just Right
| */
| @Local
| public interface Replog {
|
RobJellinghaus wrote :
| Why does @PersistenceContext work here but @In doesn't? I think I'm good
to go now (modulo the possibility that I'm still arranging my components the
wrong way, but some more code iteration will clue me in there). But I'm still
curious why the first way didn't
Ah okay, I dint know that you had the EntityManager defined in the
components.xml. Ill give that a try(with this setup) and see what comes up.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3967611#3967611
Reply to the post :
I just tried this -- with both the application and session scopes and they
worked fine. I just modified the registration app that comes with the Seam
distro to do this. Ill be interested to take a look at your app though.
Raja
rajasaur at gmail dot com
View the original post :