1 Reply Latest reply on Aug 31, 2010 1:44 PM by rstricker

    java.lang.IllegalStateException: No page context active

    rstricker
      I am a Seam novice and this exception is causing me grief.

      It is being thrown from the following code:

      The if statement with the arrows is the line throwing the exception.

               for (File f : files)
               {
                  fileName = f.getName();
      >>>         if (andesaProcessor.processBatchFile(fileName))
                  {
                       log.info("Deleting File - #0", f.getName());
                       f.delete();
                  }
                  else
                  {
                       log.error("******************");
                  }
               }
            }
            // Shouldn't be any exceptions, but log them as errors if one happens.
            catch (Exception ex)
            {
               ex.printStackTrace();
                log.error(ex);
            }

      The processBatchFile method executes successfully.  The calling class throws the exception when it returns. 

      The calling class contains this annotation:
      @Scope(ScopeType.APPLICATION)

      The called class initially had:
      @Scope(ScopeType.CONVERSATION)

      but I changed it to:
      @Scope(ScopeType.SESSION)
      @Transactional

      The @Scope change didn't affect the outcome.

      Thanks,
      Rick Stricker

      Here is the stack trace:

      10:35:28,680 ERROR [STDERR] java.lang.IllegalStateException: No page context active
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.ScopeType.getContext(ScopeType.java:127)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.Component.outjectAttribute(Component.java:1806)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.Component.outjectAttributes(Component.java:1755)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.Component.outject(Component.java:1608)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:86)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
      10:35:28,680 ERROR [STDERR]      at com.gwl.im.cdm.action.andesa.AndesaProcessor_$$_javassist_seam_11.processBatchFile(AndesaProcessor_$$_javassist_seam_11.java)
      10:35:28,680 ERROR [STDERR]      at com.gwl.im.cdm.action.asynchronous.ScheduleProcessor.processAndesaFiles(ScheduleProcessor.java:223)
      10:35:28,680 ERROR [STDERR]      at com.gwl.im.cdm.action.asynchronous.ScheduleProcessor.createQuartzAddTimer(ScheduleProcessor.java:182)
      10:35:28,680 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      10:35:28,680 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      10:35:28,680 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      10:35:28,680 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
      10:35:28,680 ERROR [STDERR]      at com.gwl.im.cdm.action.asynchronous.ScheduleProcessor_$$_javassist_seam_3.createQuartzAddTimer(ScheduleProcessor_$$_javassist_seam_3.java)
      10:35:28,680 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      10:35:28,680 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      10:35:28,680 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      10:35:28,680 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.async.AsynchronousInvocation$1.process(AsynchronousInvocation.java:62)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.async.AsynchronousInvocation.execute(AsynchronousInvocation.java:44)
      10:35:28,680 ERROR [STDERR]      at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:243)
      10:35:28,680 ERROR [STDERR]      at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      10:35:28,680 ERROR [STDERR]      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)