0 Replies Latest reply on Oct 30, 2008 11:18 AM by Bernard Labno

    AsynchronousInterceptor NullPointer on @Destroy

    Bernard Labno Master

      Seam 2.1.0.CR1
      I have method following method on JavaBean (not ejb) :


          @Destroy
          @Transactional
          public synchronized void save() {
              for (SomeEntity entity : someCollection) {
                  try {
                      em.merge(entity);
                  } catch (Exception ex) {
                      log.error("Cannot persist #0", ex, entity);
                  }
              }
          }



      When undeploying application I get :


      008-10-30 11:05:32,464 WARN  Component - Exception calling component @Destroy method: someManager
      java.lang.NullPointerException
              at org.jboss.seam.async.AsynchronousInterceptor.isExecutingAsynchronousCall(AsynchronousInterceptor.java:66)
              at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:46)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
              at test.SomeManager_$$_javassist_0.save(SomeManager_$$_javassist_0.java)



      This manager has a one method annotated with @Asynchronous but I stop it first before undeploying. What can be the problem ? Line 66 in AsynchronousInterceptor is :


      return Contexts.getEventContext().isSet(AbstractDispatcher.EXECUTING_ASYNCHRONOUS_CALL);



      So probably the context does not exist, but I do not know if it is Seam bug or what.