-
1. Re: Seam 1.0.0.GA Booking App: RegisterAction - Injected Use
theute Jun 14, 2006 8:40 PM (in response to rogerk)It seems like the Seam Interceptor doesn't intercept.
Try to add @Interceptor(SeamInterceptor.class) at the class level and let us know.
(It should be already defined in ejb-jar.xml though) -
2. Re: Seam 1.0.0.GA Booking App: RegisterAction - Injected Use
jagoh Jun 15, 2006 12:45 AM (in response to rogerk)Thomas,
Do you mean if already defined in ejb-jar.xml, at class level don't need to declare? Thanks.
JA -
3. Re: Seam 1.0.0.GA Booking App: RegisterAction - Injected Use
gavin.king Jun 15, 2006 2:44 AM (in response to rogerk)"jagoh" wrote:
Do you mean if already defined in ejb-jar.xml, at class level don't need to declare? Thanks.
You should not need to, according to the spec, but try it anyway. -
4. Re: Seam 1.0.0.GA Booking App: RegisterAction - Injected Use
rogerk Jun 15, 2006 11:41 AM (in response to rogerk)I've already done that. Here is what the class looks like:
@Stateful
@Scope(EVENT)
@Name("register")
@Interceptors(SeamInterceptor.class)
public class RegisterAction implements Register
{
@In
private User user;
......
After pressing the "Register" button in the app, it appears that the SeamInterceptor is getting called. Here is the call sequence:
SeamInterceptor.aroundInvoke method called.
@AroundInvoke
public Object aroundInvoke(InvocationContext invocation) throws Exception
{
if ( !getUnproxiedClass( invocation.getTarget() ).isAnnotationPresent(Name.class) )
{
//not a Seam component
return invocation.proceed();
}
invocation.proceed called.
eventually, RegisterAction.register method called, but "user" is null.
SeamInterceptor is set up in ejb-jar.xml *and* I have also tried it with and without the
@Interceptors(SeamInterceptor.class) in the RegisterAction class.
Any help would be greatly appreciated. Thanks, -
5. Re: Seam 1.0.0.GA Booking App: RegisterAction - Injected Use
gavin.king Jun 15, 2006 6:03 PM (in response to rogerk)OK, please try setting a breakpoint in BijectionInterceptor and see what happens....
-
6. Re: Seam 1.0.0.GA Booking App: RegisterAction - Injected Use
rogerk Jun 15, 2006 9:41 PM (in response to rogerk)BijectionInterceptor is never getting called. I've done a comparison with the working 1.0beta version and the FCS version.
---------------
FCS Version
---------------
Register button pressed.
SeamInterceptor.aroundInvoke called
----> if ( !getUnproxiedClass( invocation.getTarget() ).isAnnotationPresent(Name.class) )
is true. Looks like it can't find "@Name" annotation on
"org.jboss.seam.example.booking._RegisterAction_Serializable"
As a result, "invocation.proceed" is always called, and
"aroundInvokeInContexts" is not called.
As a result, SeamInvocationContext is never called and
BijectionInterceptor is never called.
I've tried making it so "aroundInvokeInContexts" is called in SeamInterceptor.
Here is the result of that:
SeamInterceptor.aroundInvoke called
----> aroundInvokeInContexts called.
----> getSeamComponent called.
----> Seam.getComponentName("org.jboss.seam.example.booking._RegisterAction_Serializable") called.
**** return value is null ****
Therefore SeamInvocationContext.proceed is never getting called.
-------------------
1.0beta Version
-------------------
Register button pressed.
SeamInterceptor.aroundInvoke called
----> aroundInvokeInContexts called.
----> getSeamComponent called.
----> Seam.getComponentName("org.jboss.seam.example.booking._RegisterAction_Serializable") called.
**** RETURNS A VALUE ****
**** SeamInvocationContext.proceed is called, and
**** BijectionInterceptor is called.
Values are injected properly. -
7. Re: Seam 1.0.0.GA Booking App: RegisterAction - Injected Use
gavin.king Jun 15, 2006 10:28 PM (in response to rogerk)OK, so GlassFish is subclassing the session bean, and I should be searching up the class hierarchy for the @Name annotation.
I will get this one fixed. -
8. Re: Seam 1.0.0.GA Booking App: RegisterAction - Injected Use
rogerk Jun 15, 2006 10:55 PM (in response to rogerk)Ok. Thanks for looking at this. So it sounds like your potential fix wlll make it so
the Name annotation will be found, and "aroundInvokeInContexts" will be called.
The other problem was that even when I forced a call to "aroundInvokeInContexts"
Seam.getComponentName("org.jboss.seam.example.booking._RegisterAction_Serializable")
returned null.
Wil your fix address that as well?
Thanks. -
9. Re: Seam 1.0.0.GA Booking App: RegisterAction - Injected Use
gavin.king Jun 15, 2006 11:38 PM (in response to rogerk)Yes, it is the same underlying problem.
-
10. Re: Seam 1.0.0.GA Booking App: RegisterAction - Injected Use
gavin.king Jun 16, 2006 12:08 AM (in response to rogerk)Roger, I just committed an attempt at a fix to CVS. Would you try it out please? Thanks