This content has been marked as final.
Show 6 replies
-
1. Re: @Create not called 100% of the time
matt.drees Aug 24, 2007 1:05 PM (in response to chane)Just to clarify, find() and next() are not called in the same request, right?
-
2. Re: @Create not called 100% of the time
matt.drees Aug 24, 2007 1:06 PM (in response to chane)oops. duh. Read your post wrong. Sorry.
-
3. Re: @Create not called 100% of the time
chane Aug 24, 2007 1:20 PM (in response to chane)"matt.drees" wrote:
Just to clarify, find() and next() are not called in the same request, right?
Correct. Each call is in a separate request (click from the GUI).
Chris... -
4. Re: @Create not called 100% of the time
chane Aug 24, 2007 1:39 PM (in response to chane)I have been able to track it down to a specific place in the Seam code; but now I'm stuck as to how to debug next.....
In Component.callComponentMethod the following is being executed:public Object callComponentMethod(Object instance, Method method, Object... parameters) { Class[] paramTypes = method.getParameterTypes(); String methodName = method.getName(); if("bo.activity.finder".equals(name)) log.fatal("1 CALLING CREATE METHOD["+methodName+"]"); try { Method interfaceMethod = instance.getClass().getMethod(methodName, paramTypes); if ( paramTypes.length==0 || interfaceMethod.getParameterTypes().length==0 ) { if("bo.activity.finder".equals(name)) log.fatal("2 CALLING CREATE METHOD["+methodName+"] interfaceMethod["+interfaceMethod+"]"); return Reflections.invokeAndWrap(interfaceMethod, instance); } else if ( parameters.length>0 ) {interfaceMethod["+interfaceMethod+"]"); return Reflections.invokeAndWrap(interfaceMethod, instance, parameters); } else {interfaceMethod["+interfaceMethod+"]"); return Reflections.invokeAndWrap(interfaceMethod, instance, this); } } catch (NoSuchMethodException e) { String message = "method not found: " + method.getName() + " for component: " + name; if ( getType().isSessionBean() ) { message += " (check that it is declared on the session bean business interface)"; } throw new IllegalArgumentException(message, e); } }
Theif("bo.activity.finder".equals(name)) log.fatal("2 CALLING CREATE METHOD["+methodName+"] return Reflections.invokeAndWrap(interfaceMethod, instance);
Is not being executed correctly. When the session has not expired I get this stack trace:13:20:26,937 FATAL [Component] NEW COMPONENT[bo.activity.finder] STATE[EVENT] !STATELESS[true] hasCreate[true] 13:20:26,937 FATAL [Component] 1 CALLING CREATE METHOD[initialize] 13:20:26,937 FATAL [Component] 2 CALLING CREATE METHOD[initialize] interfaceMethod[public final void com.itsolut.backoffice.actions.contact.activity.inf.IActivityGenericFinder$$EnhancerByCGLIB$$5d882077.initialize()] 13:20:26,937 FATAL [AppUtils] INITING java.lang.Exception at com.itsolut.backoffice.actions.contact.activity.ActivityGenericFinder.init(ActivityGenericFinder.java:49) at com.itsolut.core.action.Finder.initialize(Finder.java:80) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
When I execute the next() after the session is expired I get:13:22:46,609 FATAL [Component] NEW COMPONENT[bo.activity.finder] STATE[EVENT] !STATELESS[true] hasCreate[true] 13:22:46,609 FATAL [Component] 1 CALLING CREATE METHOD[initialize] 13:22:46,609 FATAL [Component] 2 CALLING CREATE METHOD[initialize] interfaceMethod[public final void com.itsolut.backoffice.actions.contact.activity.inf.IActivityGenericFinder$$EnhancerByCGLIB$$5d882077.initialize()] ... and then nothing...the LOG message for INIT is not here like above
Seam looks like it is trying to invoke the @Create method. It just is never actually invoked.
Thoughts? Is this a CGLIB issue?
Chris.... -
5. Re: @Create not called 100% of the time
chane Aug 24, 2007 3:05 PM (in response to chane)I'm not sure what was happening as I had compiled/deployed several times. However, I did a "clean" dist and that seems to have cleared up the issue.
Strange....
At least I learned a little more about the internals of Seam.
Chris.... -
6. Re: @Create not called 100% of the time
matt.drees Aug 24, 2007 3:34 PM (in response to chane)Yeah, I've had experiences like that. Definitely frustrating.
It is kinda cool learning how Seam works, though.
Glad it's working for you.