1 Reply Latest reply on Dec 29, 2009 3:49 PM by tausuahmed

    Can't invoke an Asynchronous method

    agori

      My settings are Seam 2.1.1, JBoss 4.2.2, Quartz 1.6.
      I am deploying a WAR (no EJB). Seam 2.1.1 works fine with this setup, but I can't invoke an asynchronous method:


      @Name("previewBean") @Scope(ScopeType.PAGE)
      public class PreviewBean implements Serializable {
           
           @In ShellService service;
           
           private FoglioCassaType foglioCassa;
           
           @Asynchronous
           public void processTotals() {
                foglioCassa = service.getFoglioCassaCorrente();
           }
           
           public FoglioCassaType getFoglioCassa() {
                return foglioCassa;
           }
      
      }
      
      



      My Test is


           @Test
           public void processTotals() throws Exception {
                new FacesRequest("/home.xhtml") {
                     @Override protected void invokeApplication() {
                          invokeMethod("#{previewBean.processTotals}"); 
                     }
                }.run();
           }
      



      and my components.xml contains this


      <async:quartz-dispatcher/>
      



      I get a short exception (also in JBoss not only in tests):


      09:41:51,062 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutting down.
      09:41:51,062 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED paused.
      09:41:51,062 ERROR [AsynchronousExceptionHandler] Exeception thrown whilst executing asynchronous call
      java.lang.NullPointerException
           at org.jboss.seam.async.AsynchronousInvocation$1.process(AsynchronousInvocation.java:55)
           at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80)
           at org.jboss.seam.async.AsynchronousInvocation.execute(AsynchronousInvocation.java:44)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:243)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      09:41:51,062 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete.