[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-438) When setting log level to trace, NullPointer occurs in RootInterceptor

Guy Veraghtert (JIRA) jira-events at jboss.com
Wed Oct 25 11:49:41 EDT 2006


When setting log level to trace, NullPointer occurs in RootInterceptor
----------------------------------------------------------------------

                 Key: JBSEAM-438
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-438
             Project: JBoss Seam
          Issue Type: Bug
    Affects Versions: 1.1.0.CR1
            Reporter: Guy Veraghtert


When setting log level to trace, NPE occurs in method invokeInContexts of RootInterceptor class.

According to the EJB 3 spec, p. 308, method getMethod of class InvocationContext returns null for lifecycle callbacks.
The invokeInContexts method is invoked in the PostConstruct, resulting in a NPE: 

            log.trace("intercepted: " + getComponent().getName() + '.' + invocation.getMethod().getName());

Locally patched this way:

   private Object invokeInContexts(InvocationContext invocation, EventType eventType) throws Exception
   {
      if ( isProcessInterceptors() )
      {
         if ( log.isTraceEnabled() ) 
         {
        	 //FIXME Fixed problem with the invocationContext in @AfterConstruct getMethod() returns null! (see spec p. 308)
        	 log.trace("intercepted: " + getComponent().getName() + '.' + ((invocation.getMethod() !=null) ? invocation.getMethod().getName() : "POSTCONSTRUCT"));
         }
         return new SeamInvocationContext( invocation, eventType, userInterceptors, getComponent().getInterceptors(type) ).proceed();
      }
      else {
         if ( log.isTraceEnabled() ) 
         {
            log.trace("not intercepted: " + getComponent().getName() + '.' + invocation.getMethod().getName());
         }
         return invocation.proceed();
      }
   }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list