1 Reply Latest reply on Aug 23, 2006 10:59 AM by gavin.king

    Messaging in Seam

      In Seam reference from CVS is :

      Message-driven beans may even be Seam components, in which case it is possible to inject other event and application scoped Seam components.


      But this not works. I get NPE when I send message to MDB annotated with @Name:
      Caused by: java.lang.NullPointerException
       at org.jboss.seam.Component.forName(Component.java:1298)
       at org.jboss.seam.ejb.SeamInterceptor.getSeamComponent(SeamInterceptor.java:193)
       at org.jboss.seam.ejb.SeamInterceptor.postConstruct(SeamInterceptor.java:72)
       at sun.reflect.GeneratedMethodAccessor219.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.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:131)
       at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:105)
       ... 15 more



      I have also problems with ManagedQueueSender it works but when Seam tries to destroy component it throws Exceptions:

      11:28:13,946 DEBUG [Lifecycle] destroying event context
      11:28:13,947 DEBUG [Contexts] destroying: org.jboss.seam.core.manager
      11:28:13,947 DEBUG [Contexts] destroying: queueSender
      11:28:13,947 ERROR [STDERR] java.lang.NullPointerException
      11:28:13,948 ERROR [STDERR] at org.jboss.seam.jms.ManagedQueueSender.destroy(ManagedQueueSender.java:59)
      11:28:13,948 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:28:13,948 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      11:28:13,948 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      11:28:13,948 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:28:13,948 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
      11:28:13,948 ERROR [STDERR] at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:82)
      11:28:13,948 ERROR [STDERR] at org.jboss.seam.Component.callComponentMethod(Component.java:1476)
      11:28:13,949 ERROR [STDERR] at org.jboss.seam.Component.callDestroyMethod(Component.java:1464)
      11:28:13,949 ERROR [STDERR] at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:189)
      11:28:13,949 ERROR [STDERR] at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:638)
      11:28:13,949 ERROR [STDERR] at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:158)
      11:28:13,949 ERROR [STDERR] at org.jboss.seam.ejb.SeamInterceptor.invoke(SeamInterceptor.java:157)
      11:28:13,949 ERROR [STDERR] at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:130)
      11:28:13,949 ERROR [STDERR] at org.jboss.seam.interceptors.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:58)
      11:28:13,949 ERROR [STDERR] at org.jboss.seam.interceptors.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:46)
      11:28:13,950 ERROR [STDERR] at web.Sender$$EnhancerByCGLIB$$2cb76983.finalize(<generated>)
      11:28:13,950 ERROR [STDERR] at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
      11:28:13,950 ERROR [STDERR] at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
      11:28:13,950 ERROR [STDERR] at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
      11:28:13,950 ERROR [STDERR] at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
      11:28:13,950 WARN [Contexts] Could not destroy component: queueSender
      java.lang.NullPointerException
       at org.jboss.seam.jms.ManagedQueueSender.destroy(ManagedQueueSender.java:59)
       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:17)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:82)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1476)
       at org.jboss.seam.Component.callDestroyMethod(Component.java:1464)
       at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:189)
       at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:638)
       at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:158)
       at org.jboss.seam.ejb.SeamInterceptor.invoke(SeamInterceptor.java:157)
       at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:130)
       at org.jboss.seam.interceptors.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:58)
       at org.jboss.seam.interceptors.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:46)
       at web.Sender$$EnhancerByCGLIB$$2cb76983.finalize(<generated>)
       at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
       at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
       at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
       at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
      



      Am I doing something wrong or this features do not work yet?
      (Seam version from CVS)