[jboss-user] [JBoss Seam] - Re: @Create not called 100% of the time

chane do-not-reply at jboss.com
Fri Aug 24 13:39:31 EDT 2007


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);
  |       }
  |    }

The 
  |             if("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....

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077890#4077890

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077890



More information about the jboss-user mailing list