3 Replies Latest reply on Apr 12, 2007 6:01 PM by Sergey Smirnov

    PhaseListener Exception

    Spartan 029 Newbie

      Hi,
      I am fairly new to Ajax4JSF and ever since I added a4j ver. 1.1.0 to my project I been getting this PhaseListener exception: Any ideas why I get this exception.

      Thanks!!

      12:50:05,292 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) afterPhase
      java.lang.IllegalStateException: No application context active
       at org.jboss.seam.Component.forName(Component.java:1561)
       at org.jboss.seam.Component.getInstance(Component.java:1611)
       at org.jboss.seam.Component.getInstance(Component.java:1594)
       at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:46)
       at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
       at org.ajax4jsf.framework.ajax.AjaxContext.getCurrentInstance(AjaxContext.java:150)
       at org.ajax4jsf.framework.renderer.AjaxPhaseListener.afterPhase(AjaxPhaseListener.java:76)
       at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:619)


        • 1. Re: PhaseListener Exception
          Sergey Smirnov Master

          how your web.xml looks like?

          • 2. Re: PhaseListener Exception
            Spartan 029 Newbie

            This is pretty much similar to the seam booking example. And the booking example works without any exceptions.

            <?xml version="1.0" encoding="UTF-8"?>
            <web-app version="2.5"
             xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
            
             <!-- Ajax4jsf (must come first!)-->
             <filter>
             <display-name>Ajax4jsf Filter</display-name>
             <filter-name>ajax4jsf</filter-name>
             <filter-class>org.ajax4jsf.Filter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>ajax4jsf</filter-name>
             <url-pattern>*.seam</url-pattern>
             </filter-mapping>
            
             <context-param>
             <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
             <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>
             </context-param>
            
             <!-- Seam -->
            
             <listener>
             <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
             </listener>
            
             <!-- Propagate conversations across redirects -->
             <filter>
             <filter-name>Seam Redirect Filter</filter-name>
             <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>Seam Redirect Filter</filter-name>
             <url-pattern>*.seam</url-pattern>
             </filter-mapping>
            
             <filter>
             <filter-name>Seam Exception Filter</filter-name>
             <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>Seam Exception Filter</filter-name>
             <url-pattern>*.seam</url-pattern>
             </filter-mapping>
            
            
             <context-param>
             <param-name>org.jboss.seam.core.init.debug</param-name>
             <param-value>true</param-value>
             </context-param>
            
             <!-- JSF -->
             <context-param>
             <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
             <param-value>client</param-value>
             </context-param>
            
             <context-param>
             <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
             <param-value>.xhtml</param-value>
             </context-param>
            
             <context-param>
             <param-name>facelets.DEVELOPMENT</param-name>
             <param-value>true</param-value>
             </context-param>
            
             <context-param>
             <param-name>javax.faces.CONFIG_FILES</param-name>
             <param-value>/WEB-INF/navigation.xml</param-value>
             </context-param>
            
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
             </servlet>
            
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.seam</url-pattern>
             </servlet-mapping>
            
             <!-- MyFaces -->
             <listener>
             <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
             </listener>
            
             <filter>
             <filter-name>State Servlet Filter</filter-name>
             <filter-class>org.jboss.seam.servlet.SeamServletFilter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>State Servlet Filter</filter-name>
             <url-pattern>*.ajax</url-pattern>
             </filter-mapping>
            
             <servlet>
             <servlet-name>Seam Remoting</servlet-name>
             <servlet-class>org.jboss.seam.remoting.SeamRemotingServlet</servlet-class>
             </servlet>
             <servlet-mapping>
             <servlet-name>Seam Remoting</servlet-name>
             <url-pattern>/seam/remoting/*</url-pattern>
             </servlet-mapping>
             <!-- Welcome pages -->
             <welcome-file-list>
             <welcome-file>demo.html</welcome-file>
             <welcome-file>index.htm</welcome-file>
             </welcome-file-list>
            
            </web-app>
            
            


            • 3. Re: PhaseListener Exception
              Sergey Smirnov Master

              So, everything looks good from the Ajax4jsf point of view. Try to ask this question on the Seam forum as soon as exception comes from seam code.