2 Replies Latest reply on Mar 2, 2009 5:31 PM by jguglielmin

    No active application scope

    adamo901

      I am using SEAM 2.1.1GA with GLASSFISH 2


      this is my pages.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <pages xmlns="http://jboss.com/products/seam/pages"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd"
      
             no-conversation-view-id="/home.xhtml"
             login-view-id="/login.xhtml">
      
          <page view-id="*">
              <navigation>
                  <rule if-outcome="home">
                      <redirect view-id="/home.xhtml"/>
                  </rule>
              </navigation>
          </page>
      
          <page view-id="/extras.xhtml" login-required="true" >
              <restrict>#{s:hasRole('admin')}</restrict>
          </page>
      
          <exception class="org.jboss.seam.framework.EntityNotFoundException">
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Record not found</message>
              </redirect>
          </exception>
          
          <exception class="javax.persistence.EntityNotFoundException">
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Record not found</message>
              </redirect>
          </exception>
          
          <exception class="javax.persistence.EntityExistsException">
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Duplicate record</message>
              </redirect>
          </exception>
          
          <exception class="javax.persistence.OptimisticLockException">
              <end-conversation/>
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Another user changed the same data, please try again</message>
              </redirect>
          </exception>
          
          <exception class="org.jboss.seam.security.AuthorizationException">
              <redirect view-id="/error.xhtml">
                  <message severity="error">You don't have permission to access this resource</message>
              </redirect>
          </exception>
      
          <exception class="org.jboss.seam.security.NotLoggedInException">
              <redirect view-id="/login.xhtml">
                  <message severity="warn">Connectez-vous SVP!</message>
              </redirect>
          </exception>
      
          <exception class="javax.faces.application.ViewExpiredException">
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Your session has timed out, please try again</message>
              </redirect>
          </exception>
          <!-- 
          <exception class="org.jboss.seam.ConcurrentRequestTimeoutException" log-level="trace">
            <http-error error-code="503" />
          </exception>
            
          <exception>
              <redirect view-id="/error.xhtml">
                  <message severity="error">Unexpected error, please try again</message>
              </redirect>
          </exception>
          -->
      </pages>
      


      This is login.page.xml



      <?xml version="1.0" encoding="UTF-8"?>
      <page xmlns="http://jboss.com/products/seam/pages"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd">
         <navigation from-action="#{identity.login}">
            <rule if="#{identity.loggedIn}">
               <redirect view-id="/home.xhtml"/>
            </rule>
         </navigation>
      </page>
      



      this is menu.xhtml



      <rich:toolBar
          xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:s="http://jboss.com/products/seam/taglib"
          xmlns:rich="http://richfaces.org/rich">
          <rich:toolBarGroup>
              <h:outputText value="#{projectName}:"/>
              <s:link view="/home.xhtml" value="Home" propagation="none"/>
          </rich:toolBarGroup>
          <!-- @newMenuItem@ -->
          <rich:toolBarGroup location="right">
              <h:outputText value="signed in as: #{identity.username}" rendered="#{identity.loggedIn}"/>
              <s:link propagation="none" value="List"   view="/extras.xhtml" />
              <s:link propagation="none" value="Login"   view="/login.xhtml" rendered="#{not identity.loggedIn}" />
              <s:link propagation="none" value="Logout"  view="/home.xhtml" action="#{identity.logout}"  rendered="#{identity.loggedIn}"/>
          </rich:toolBarGroup>
      </rich:toolBar>



      Whene I login then I click on List: every thing is ok
      But when I logout, then I click on List: I am redirected to the login form.
      After that, when I login, I get the following error :



       WARN [httpSSLWorkerThread-8383-1] (SeamPhaseListener.java:199) - uncaught exception, passing to exception handler
      java.lang.IllegalStateException: No active application scope
              at org.jboss.seam.core.Init.instance(Init.java:115)
              at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:332)
              at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:243)
              at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
              at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
              at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
              at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
              at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
              at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
              at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
              at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
              at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
      ERROR [httpSSLWorkerThread-8383-1] (SeamPhaseListener.java:213) - swallowing exception
      java.lang.IllegalStateException: No active application scope
              at org.jboss.seam.core.Init.instance(Init.java:115)
              at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:332)
              at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:243)
              at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
              at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
              at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
              at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
              at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
              at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
              at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
              at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
              at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
              at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
              at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
              at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
      



      this is my components.xml:


      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
                  xmlns:core="http://jboss.com/products/seam/core"
                  xmlns:persistence="http://jboss.com/products/seam/persistence"
                  xmlns:drools="http://jboss.com/products/seam/drools"
                  xmlns:bpm="http://jboss.com/products/seam/bpm"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:mail="http://jboss.com/products/seam/mail"
                  xmlns:web="http://jboss.com/products/seam/web"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
      
          <security:identity authenticate-method="#{loginAction.login}"/>
          <core:init jndi-pattern="java:comp/env/qt2-ejb/#{ejbName}/local"/>
      </components>



      Can you help please?!

        • 1. Re: No active application scope
          etirk

          The same problem occurs using icefaces (trunk) seam (trunk) running on 4.2.3 with latest RI of jsf(u12).
          This is thus not a problem in richfaces or icefaces, nor in the application server.
          This must be a problem in how seam handles the lifecycle on invalidation of the session...i suppose.
          Sorry I cannot help here. But then again, keeping up to trunk with seam, I can conclude that seam framework has not been under
          much development lately. Some documentation and some minor fixes.
          I suppose the jboss-dudes are focusing on webbeans and practically don't really gives about seam anymore :(


          /K

          • 2. Re: No active application scope
            jguglielmin

            This is  a pretty generic exception statement when something is not found in any of the Seam contexts.  Seam goes through all the contexts looking for the seam component and when it doesn't find it, you will more than likely get this stack trace. Usually you also get the caused by statement which then tells you what it couldn't find somewhere in the stack trace.  Perhaps you want to look more closely at this?  Once you find that, you can look at your application closely to see why it can't find the component in the appropriate context that you have placed it.  Another approach is to take one of the simpler examples and try to see why you don't get the same exception there. (?).  Hope this helps.