1 Reply Latest reply on Jun 8, 2008 1:28 AM by Daniel Roth

    Help please! Mail from MDB how?

    Bernhard Hurzeler Novice

      I have a MDB that uses the AsynchronousMailProcessor from the examples.



      seam-2.0.2.SP1
      jboss-4.2.4GA
      java 1.6.0_02



      @AutoCreate
      
      @Name("ETLMDB")
      
      @Scope(ScopeType.APPLICATION)
      
      @MessageDriven(activationConfig =
      
      {
      
           @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
      
           @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/nab/ETL") })
      
      public class ETLMDB implements MessageListener
      
      {...
      
          @In
      
          private AsynchronousMailProcessor asynchronousMailProcessor;
      
      
          public void onMessage(Message recvMsg)
      
          {
      
           asynchronousMailProcessor.scheduleSend(3000, "something");
      
          }
      
      }
      
      


      And I get


      22:09:33,234 ERROR [STDERR] java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
      
      22:09:33,250 ERROR [STDERR]      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:256)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.mock.MockFacesContext.<init>(MockFacesContext.java:60)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.ui.facelet.FaceletsRenderer$RenderingContext.init(FaceletsRenderer.java:96)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.ui.facelet.FaceletsRenderer$RenderingContext.run(FaceletsRenderer.java:78)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:170)
      
      22:09:33,250 ERROR [STDERR]      at com.nab.domain.session.AsynchronousMailProcessor.scheduleSend(AsynchronousMailProcessor.java:30)
      
      22:09:33,250 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
      22:09:33,250 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
      
      22:09:33,250 ERROR [STDERR]      at com.nab.domain.session.AsynchronousMailProcessor_$$_javassist_5.scheduleSend(AsynchronousMailProcessor_$$_javassist_5.java)
      
      22:09:33,250 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
      22:09:33,250 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
      
      22:09:33,250 ERROR [STDERR]      at org.jboss.seam.async.ThreadPoolDispatcher$RunnableAsynchronous.run(ThreadPoolDispatcher.java:126)
      
      22:09:33,250 ERROR [STDERR]      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at java.util.concurrent.FutureTask.run(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      
      22:09:33,250 ERROR [STDERR]      at java.lang.Thread.run(Unknown Source)



      What am I missing? Is it possible to send an email from an MDB?


      Thanks for your help!