13 Replies Latest reply on Nov 15, 2006 4:05 PM by Charles (Chuck) Canning

    @Log and NullPointerException

    Bradley Smith Master

      I have a class,

      @Name("applicationSelectorData")
      @Scope(ScopeType.CONVERSATION)
      @Conversational(ifNotBegunOutcome = "home")
      public class ApplicationSelectorData implements Serializable {
      
       @Logger
       private Log log;
      
       @Out(required=false)
       private List<SelectItem> applicationItems;
      
       .....
      
       @Observer("ApplicationSaved")
       public void applicationSavedListener() {
       log.info("applicationSavedListener() : "+EventType.ApplicationSaved.name());
       if (this.availableApplications != null) {
       this.availableApplications.clear();
       }
       }
      
      }
      


      that uses the @Logger + Log of Seam to provide a logger. During execution of an @Observer method in this class, the LogImpl class in Seam is throwing a NullPointerException. It looks like the internal log variable of LogImpl is not getting set... is this a bug?

      java.lang.NullPointerException
       at org.jboss.seam.log.LogImpl.isInfoEnabled(LogImpl.java:49)
       at org.jboss.seam.log.LogImpl.info(LogImpl.java:96)
       at com.evergreen.accesscontrol.ApplicationSelectorData.applicationSavedListener(ApplicationSelectorData.java:99)
       at com.evergreen.accesscontrol.ApplicationSelectorData$$FastClassByCGLIB$$a574850e.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
       at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:51)
       at sun.reflect.GeneratedMethodAccessor239.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:79)
       at sun.reflect.GeneratedMethodAccessor238.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
       at sun.reflect.GeneratedMethodAccessor237.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:33)
       at sun.reflect.GeneratedMethodAccessor240.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:55)
       at sun.reflect.GeneratedMethodAccessor236.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
       at sun.reflect.GeneratedMethodAccessor235.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ConversationalInterceptor.checkConversationForConversationalBean(ConversationalInterceptor.java:82)
       at sun.reflect.GeneratedMethodAccessor234.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
       at sun.reflect.GeneratedMethodAccessor233.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
       at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
       at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:128)
       at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:69)
       at com.evergreen.accesscontrol.ApplicationSelectorData$$EnhancerByCGLIB$$321fae77.applicationSavedListener(<generated>)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1738)
       at org.jboss.seam.core.Events.raiseEvent(Events.java:111)
       at com.evergreen.accesscontrol.impl.RoleManagerBean.saveRoles(RoleManagerBean.java:150)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
       at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
       at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:51)
       at sun.reflect.GeneratedMethodAccessor239.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:79)
       at sun.reflect.GeneratedMethodAccessor238.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
       at sun.reflect.GeneratedMethodAccessor237.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:55)
       at sun.reflect.GeneratedMethodAccessor236.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
       at sun.reflect.GeneratedMethodAccessor235.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ConversationalInterceptor.checkConversationForConversationalBean(ConversationalInterceptor.java:82)
       at sun.reflect.GeneratedMethodAccessor234.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
       at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
       at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:46)
       at sun.reflect.GeneratedMethodAccessor242.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.j
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:201)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:188)
       at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
       at $Proxy166.saveRoles(Unknown Source)
       at com.evergreen.accesscontrol.RoleManager$$FastClassByCGLIB$$8e8ff14c.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
       at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:68)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
       at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:39)
       at sun.reflect.GeneratedMethodAccessor241.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
       at sun.reflect.GeneratedMethodAccessor233.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
       at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
       at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:77)
       at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:47)
       at com.evergreen.accesscontrol.RoleManager$$EnhancerByCGLIB$$2caf8576.saveRoles(<generated>)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
       at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
       at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
       at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
       at javax.faces.component.UICommand.broadcast(UICommand.java:106)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
       at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.evergreen.filter.RequestDumper.doFilter(RequestDumper.java:78)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at com.evergreen.fastpass.catalina.CASSSOAuthenticatorValve.invoke(CASSSOAuthenticatorValve.java:371)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      


      Thanks

        • 1. Re: @Log and NullPointerException
          Gavin King Master

          Can you reproduce this in a very simple test case and submit to JIRA?

          I'm not sure the cause, but I think someone else complained about something like this.

          • 2. Re: @Log and NullPointerException
            Bradley Smith Master

            right now it occurs in a method marked @Observer, but I will try to create a test case that reproduces this using the event-listener @Observer functionality.

            Thanks,

            • 3. Re: @Log and NullPointerException
              Gavin King Master

              Hum, I just made a commit to CVS, I'm now using Externalizable instead of Serializable. I suspect a bug in JBoss EJB3. Can you grap a build from CVS and try that for me? thanks.

              • 4. Re: @Log and NullPointerException
                Stas Garifulin Newbie

                Now it complains about missing no-args constructor in LogImpl:

                java.io.InvalidClassException: org.jboss.seam.log.LogImpl; no valid constructor
                 at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:455)
                 at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:297)
                 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:531)
                 at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552)
                 at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
                 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
                 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
                 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
                 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
                 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
                 at java.util.HashMap.readObject(HashMap.java:1067)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
                 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
                 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                 at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
                 at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
                 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
                 at com.sun.faces.application.StateManagerImpl$TreeNode.readExternal(StateManagerImpl.java:671)
                 at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
                 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
                 at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
                 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
                 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
                 at com.sun.faces.renderkit.ResponseStateManagerImpl.getTreeStructureToRestore(ResponseStateManagerImpl.java:149)
                 at javax.faces.render.ResponseStateManager.getState(ResponseStateManager.java:215)
                 at com.sun.faces.application.StateManagerImpl.restoreTree(StateManagerImpl.java:552)
                 at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:90)
                 at org.jboss.seam.jsf.SeamStateManager.restoreView(SeamStateManager.java:97)
                 at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:288)
                 at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:127)
                 at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:317)
                 at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:142)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
                 at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:63)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
                 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
                 at java.lang.Thread.run(Thread.java:595)
                


                Currently java serialization api totally ignores readObject methods of serialazable seam component itself and any of it fields type. Simple test case:

                package demo;
                
                import java.io.IOException;
                import java.io.ObjectInputStream;
                import java.io.Serializable;
                
                import org.jboss.seam.ScopeType;
                import org.jboss.seam.annotations.Logger;
                import org.jboss.seam.annotations.Name;
                import org.jboss.seam.annotations.Scope;
                import org.jboss.seam.log.Log;
                
                @SuppressWarnings("serial")
                @Name("transientTest")
                @Scope(ScopeType.PAGE)
                public class TransientTest implements Serializable {
                
                 @Logger
                 private Log log;
                
                 private transient String message = "initial";
                
                 public void testSeamLog() {
                 log.error(message);
                 }
                
                 public void testTransientField() {
                 message.equals("restored");
                 }
                
                 void readObject(ObjectInputStream ois) throws ClassNotFoundException,
                 IOException {
                 ois.defaultReadObject();
                
                 message = "restored";
                 }
                
                 public String getMessage() {
                 return message;
                 }
                }
                
                


                And test page:

                <?xml version="1.0" encoding="UTF-8" ?>
                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                <html xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core">
                
                <body>
                 <h:form>
                 <h:outputText value="#{transientTest.message}" /><br />
                 <h:commandButton action="#{transientTest.testSeamLog}" value="Test Seam Log" />
                 <h:commandButton action="#{transientTest.testTransientField}" value="Test Transient Field" />
                 </h:form>
                </body>
                </html>
                
                


                • 5. Re: @Log and NullPointerException
                  Gavin King Master

                  OK, I added one. Try again now.

                  • 6. Re: @Log and NullPointerException
                    Stas Garifulin Newbie

                    Forgot to say, with no arg constructor added, LogImpl works fine now.

                    • 9. Re: @Log and NullPointerException
                      Bradley Smith Master

                      I haven't been able to try a CVS build since your post asking me to try it but I wanted to provide some more data around the problem.

                      - first adding a no-arg constructor to LogImpl didn't help (but again, I haven't tried the request CVS stuff yet)

                      - second, let me explain the execution context a bit.

                      I have an .ear application - the EJB's reside in their own jar, the webapp resides in a .war. The class that is experiencing the exception from LogImpl has an @Observer method for an event generated by a SFSB in the EJB jar. - NOTE - the class that has the @Observer method is bundled in the .war. It seems that in all our other uses of @Logger in the EJB's, there are no such issues. It's this one class in the war that has the problems.

                      Another aspect of the problem is when I remove the @Logger and convert over to a typical commons-logging Log - LogFactory impl in the observer class, I get a different type of exception

                      javax.faces.FacesException: java.io.NotSerializableException: org.apache.log4j.Level
                       at org.apache.myfaces.shared_impl.util.StateUtils.getAsByteArray(StateUtils.java:190)
                       at org.apache.myfaces.shared_impl.util.StateUtils.construct(StateUtils.java:150)
                       at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.writeState(HtmlResponseStateManager.java:102)
                       at org.apache.myfaces.application.jsp.JspStateManagerImpl.writeState(JspStateManagerImpl.java:430)
                       at org.jboss.seam.jsf.SeamStateManager.writeState(SeamStateManager.java:66)
                       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:606)
                       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
                       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                       at com.evergreen.filter.RequestDumper.doFilter(RequestDumper.java:78)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                       at com.evergreen.fastpass.catalina.CASSSOAuthenticatorValve.invoke(CASSSOAuthenticatorValve.java:371)
                       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                       at java.lang.Thread.run(Thread.java:595)
                      Caused by: java.io.NotSerializableException: org.apache.log4j.Level
                       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
                       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
                       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
                       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
                       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
                       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
                       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
                       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
                       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
                       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
                       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
                       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
                       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
                       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
                       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
                       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
                       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
                       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
                       at java.util.HashMap.writeObject(HashMap.java:985)
                       at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:585)
                       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
                       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
                       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
                       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
                       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
                       at java.util.HashMap.writeObject(HashMap.java:985)
                       at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:585)
                       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
                       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
                       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
                       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
                       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
                       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
                      
                      


                      The idea behind the class in the war is that it maintains a collection of 'applications' (application is an entity in our domain). The event-generating SFSB sends out an event whenever an applications editted, added, activated, deactivated, and we need to update the collection in response to such an event. The SFSB is a DAO of sorts for application and collections of applications. The .war class that maintains a collection has no logic for querying the applications - rather, it delegates the loading to the SFSB.



                      • 10. Re: @Log and NullPointerException
                        Gavin King Master

                        Please try the latest CVS. I did more than adding a constructor! (I switched from Serializable to Externalizable.)

                        • 11. Re: @Log and NullPointerException
                          Charles (Chuck) Canning Newbie

                          I have an @Entity that is a seam managed component @Name and my @Logger is null. Is this related to this issue or is it a different issue that I should post?

                          • 12. Re: @Log and NullPointerException
                            Gavin King Master

                            @Logger (and much other Seam functionality) is not supported for entities.