4 Replies Latest reply on Mar 29, 2008 12:50 PM by Pete Muir

    Problem when generate faces response with non-faces request in SEAM:(

    Slava Davidovich Newbie

      Hi, All. I have some problem, when try to use custom HttpServlet in SEAM.
      If I does not use custom servlet - all OK, page renders, data exist and all cool (no errors, no warnings). If I use application scope as storage for my custom servlet and controller - all works, but I have errors on render phase :(
      If I use conversation context - nothing works, error does not changes, but xhtml can not find controller :( so no data at result :( Could anybody help me? Big thanks for answers.


      P.s.
      SEAM JIRA bug here  - bug repport probably was not very good, but answer was worse.


      This is error log:


      19:07:09,406 INFO  [[/exdemo-insurance]] Export Servlet: App context does not exist?
      
      19:07:09,406 INFO  [[/exdemo-insurance]] Export Servlet: but application map exist???
      
      19:07:09,421 INFO  [[/exdemo-insurance]] Export Servlet: start rendering lifecycle
      
      19:07:09,421 ERROR [SeamPhaseListener] uncaught exception
      
      java.lang.IllegalStateException: No active application scope
      
           at org.jboss.seam.core.Init.instance(Init.java:75)
      
           at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:305)
      
           at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
      
           at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
      
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
      
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      
           at ExportServlet.doGet(ExportServlet.java:97)
      
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      
           at java.lang.Thread.run(Unknown Source)
      
      19:07:09,421 ERROR [SeamPhaseListener] swallowing exception
      
      java.lang.IllegalStateException: No active application scope
      
           at org.jboss.seam.core.Init.instance(Init.java:75)
      
           at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:305)
      
           at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
      
           at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
      
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
      
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      
           at ExportServlet.doGet(ExportServlet.java:97)
      
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      
           at java.lang.Thread.run(Unknown Source)
      
      19:07:09,421 WARN  [lifecycle] phase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@439682) threw exception: java.lang.IllegalStateException: No active application scope No active application scope
      
      org.jboss.seam.core.Init.instance(Init.java:75)
      
      org.jboss.seam.navigation.Pages.isDebugPage(Pages.java:1511)
      
      org.jboss.seam.debug.jsf.SeamDebugPhaseListener.beforePhase(SeamDebugPhaseListener.java:36)
      
      com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
      
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      
      ExportServlet.doGet(ExportServlet.java:97)
      
      javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      
      org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
      
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
      org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
      
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      
      org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
      
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
      org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
      org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      
      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      
      java.lang.Thread.run(Unknown Source)
      
      
      19:07:09,421 ERROR [SeamPhaseListener] uncaught exception
      
      java.lang.IllegalStateException: No active application scope
      
           at org.jboss.seam.core.Init.instance(Init.java:75)
      
           at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:321)
      
           at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:233)
      
           at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:184)
      
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
      
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      
           at ExportServlet.doGet(ExportServlet.java:97)
      
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      
           at java.lang.Thread.run(Unknown Source)
      
      19:07:09,421 ERROR [SeamPhaseListener] swallowing exception
      
      java.lang.IllegalStateException: No active application scope
      
           at org.jboss.seam.core.Init.instance(Init.java:75)
      
           at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:321)
      
           at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:233)
      
           at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:184)
      
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
      
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      
           at ExportServlet.doGet(ExportServlet.java:97)
      
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      
           at java.lang.Thread.run(Unknown Source)
      
      




      This is mapping:


      <servlet>
      
                <servlet-name>Faces Servlet</servlet-name>
      
                <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      
                <load-on-startup>1</load-on-startup>
      
           </servlet>
      
           
      
           <servlet>
      
                <servlet-name>Export Servlet</servlet-name>
      
                <servlet-class>ExportServlet</servlet-class>
      
                <load-on-startup>1</load-on-startup>
      
           </servlet>
      
           <servlet-mapping>
      
                <servlet-name>Faces Servlet</servlet-name>
      
                <url-pattern>*.xhtml</url-pattern>
      
           </servlet-mapping>
      
      
           <servlet-mapping>
      
                <servlet-name>Export Servlet</servlet-name>
      
                <url-pattern>/mywork/template/exportTable.xhtml</url-pattern>
      
           </servlet-mapping>



      This is the class of servlet:


      import java.io.IOException;
      
      import java.util.Map;
      
      
      import javax.faces.FactoryFinder;
      
      import javax.faces.application.ViewHandler;
      
      import javax.faces.component.UIViewRoot;
      
      import javax.faces.context.FacesContext;
      
      import javax.faces.context.FacesContextFactory;
      
      import javax.faces.lifecycle.LifecycleFactory;
      
      import javax.servlet.ServletException;
      
      import javax.servlet.http.HttpServlet;
      
      import javax.servlet.http.HttpServletRequest;
      
      import javax.servlet.http.HttpServletResponse;
      
      import org.jboss.seam.annotations.AutoCreate;
      
      import org.jboss.seam.annotations.In;
      
      import org.jboss.seam.annotations.Install;
      
      import org.jboss.seam.annotations.Scope;
      
      import org.jboss.seam.contexts.Context;
      
      import org.jboss.seam.contexts.Contexts;
      
      import org.jboss.seam.contexts.Lifecycle;
      
      import org.jboss.seam.ScopeType;
      
      
      @Scope (ScopeType.CONVERSATION)
      
      @AutoCreate
      
      @Install(precedence = Install.FRAMEWORK)
      
      public class ExportServlet extends HttpServlet {
      
           
      
           @In private Context applicationContext;
      
           
      
           private static final long serialVersionUID = 7726875120227227640L;
      
           
      
           @Override
      
           protected void doGet(HttpServletRequest request, HttpServletResponse response)
      
                     throws ServletException, IOException {
      
                response.setContentType("application/xls");
      
                response.setHeader("content-disposition", "attachment; filename=" + "report.xls");
      
                LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder
      
                     .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
      
                javax.faces.lifecycle.Lifecycle lifecycle = lifecycleFactory
      
                     .getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
      
                FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder
      
                     .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
      
                FacesContext facesContext = facesContextFactory
      
                     .getFacesContext(getServletContext(), request, response, lifecycle);
      
                String viewId = "/mywork/template/exportTable.xhtml";
      
                ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
      
                UIViewRoot view = viewHandler.createView(facesContext, viewId);
      
                facesContext.setViewRoot(view);
      
                if (getApplicationContext() != null) {
      
                     log("App context exist!");
      
                } else {
      
                     log("App context does not exist?");
      
                     Map<String, Object> app = Lifecycle.getApplication();
      
                     if (app != null) {
      
                          log("but application map exist???");
      
                     }
      
                }
      
                if (Contexts.isApplicationContextActive()) {
      
                     System.out.println("App context exist");
      
                }
      
                try {
      
                     log("start rendering lifecycle");
      
                     lifecycle.render(facesContext);
      
                } catch (Exception e) {
      
                     log(e.getMessage());
      
                     e.printStackTrace();
      
                }
      
           }
      
      
           public Context getApplicationContext() {
      
                return applicationContext;
      
           }
      
      
           public void setApplicationContext(Context applicationContext) {
      
                this.applicationContext = applicationContext;
      
           }
      
      }
      
      



      This is this XHTML :


      <ui:composition 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:a4j="http://richfaces.org/a4j"
      
           xmlns:rich="http://richfaces.ajax4jsf.org/rich">
      
           
      
           <a4j:form id="taskForm" ajaxSubmit="true">
      
              <h:panelGroup id="taskTablePanel" style="width: 100%">
      
                   <rich:dataTable id="taskTable2" value="#{myworktest.dataList}" var="row"
      
                          border="1" width="100%" cellspacing="2">
      
                          <rich:column>
      
                          <h:outputText value="#{row.id}" />
      
                          </rich:column>
      
                          <rich:column>
      
                          <h:outputText value="#{row.name}" />
      
                          </rich:column>
      
                          <rich:column>
      
                          <h:outputText value="#{row.description}"/>
      
                          </rich:column>
      
                     </rich:dataTable>
      
                </h:panelGroup>
      
          </a4j:form>
      
      </ui:composition> 



      This is test controller which mapped to myworktest:


      import java.util.ArrayList;
      
      import java.util.List;
      
      import org.jboss.seam.ScopeType;
      
      import org.jboss.seam.annotations.AutoCreate;
      
      import org.jboss.seam.annotations.Install;
      
      import org.jboss.seam.annotations.Name;
      
      import org.jboss.seam.annotations.Scope;
      
      
      @Name("myworktest")
      
      @AutoCreate
      
      @Scope(ScopeType.CONVERSATION)
      
      @Install(precedence = Install.FRAMEWORK)
      
      public class TestController {
      
           @SuppressWarnings("unchecked")
      
           private static final List<DemoObject> MOCK_DATA_LIST = new ArrayList();
      
           private static final int LIST_SIZE = 10;
      
           private List<DemoObject> dataList = MOCK_DATA_LIST;
      
           public TestController() {
      
                if (dataList.size() == 0) { setDataList(initMock()); }
      
           }
      
           
      
           public List<DemoObject> getDataList() {
      
                return dataList;
      
           }
      
      
           public void setDataList(List<DemoObject> dataList) {
      
                this.dataList = dataList;
      
           }
      
           private static List<DemoObject> initMock() {
      
                List<DemoObject> rezult = MOCK_DATA_LIST;
      
                for (int i = 0; i < LIST_SIZE; i++) {
      
                     DemoObject obj = new DemoObject(
      
                               new Long(i), DemoObject.DEFAULT_NAME + i, DemoObject.DEFAULT_DESCRIPTION + i);
      
                     rezult.add(obj);
      
                }
      
                return rezult;
      
           }
      
      }
      
      



      This is object List of which parse xhtml:


      import java.io.Serializable;
      
      
      public class DemoObject implements Serializable {
      
           private static final long serialVersionUID = 6759357460617348501L;
      
           public static final String DEFAULT_NAME = "name";
      
           public static final String DEFAULT_DESCRIPTION = "description";
      
           private Long id;
      
           private String name;
      
           private String description;
      
           public DemoObject() {
      
                this(null, DEFAULT_NAME, DEFAULT_DESCRIPTION);
      
           }
      
           public DemoObject(Long idq , String nameq , String descriptionq) {
      
                setName(nameq);
      
                setDescription(descriptionq);
      
                if (idq != null) { setId(idq); }
      
           }
      
           
      
           public Long getId() {
      
                return id;
      
           }
      
           public void setId(Long id) {
      
                this.id = id;
      
           }
      
           public String getName() {
      
                return name;
      
           }
      
           public void setName(String name) {
      
                this.name = name;
      
           }
      
           public String getDescription() {
      
                return description;
      
           }
      
           public void setDescription(String description) {
      
                this.description = description;
      
           }
      
      }
      
      





        • 1. Re: Problem when generate faces response with non-faces request in SEAM:(
          Slava Davidovich Newbie

          Sorry I forgot to say that I use JBoss 4.2.2.GA,Seam 2.0.1.GA,Richfaces 3.1.4.GA,JDK5

          • 2. Re: Problem when generate faces response with non-faces request in SEAM:(
            Pete Muir Master

            P.s. SEAM JIRA bug here - bug report probably was not very good, but answer was worse.

            There is no need to be rude. Seam JIRA is for reporting issues in Seam, not asking questions about Seam or getting your code debugged for free.


            Your bug report and the code posted above are different.


            As I explained in the JIRA issue, you have mapped both the Faces Servlet and your custom servlet to the same URL pattern (well, in the JIRA report you hadn't in the above you have). You've also tried to use a custom servlet as a Seam component which won't work.

            • 3. Re: Problem when generate faces response with non-faces request in SEAM:(
              Slava Davidovich Newbie

              Pete Muir wrote on Mar 26, 2008 06:42 PM:

              Seam JIRA is for reporting issues in Seam, not asking questions about Seam or getting your code debugged for free.


              Pete, before write in JIRA I have investigation and read the source of SEAM. The result is when I put both component (Servlet and Controller) in application scope what I see? Magic exception that No active application scope, but data visible from application scope and servlet do that I want (render page which I set as view root)! Is not it a bug?
              And this bug can be reproduced even when use render HTML code...


              You rejected a bug - OK, but it exist want you them or not.
              I have workaround and it works stable - but I think that this example must work without workarounds, is not it, Pete?

              • 4. Re: Problem when generate faces response with non-faces request in SEAM:(
                Pete Muir Master

                Slava Davidovich wrote on Mar 27, 2008 09:29 AM:


                Pete, before write in JIRA I have investigation and read the source of SEAM. The result is when I put both component (Servlet and Controller) in application scope what I see? Magic exception that No active application scope, but data visible from application scope and servlet do that I want (render page which I set as view root)! Is not it a bug?
                And this bug can be reproduced even when use render HTML code...


                Please READ my post and the documentation. Where does it say you can use injection in a Servlet? Where does it say putting Seam annotations onto a servlet will do anything?



                You rejected a bug - OK, but it exist want you them or not.

                The bug exists in your understanding of Seam, not in Seam. If you can post a clean example of your problem that is consistent and actually valid, then we can take a look.



                I have workaround and it works stable - but I think that this example must work without workarounds, is not it, Pete?

                Of course it won't work. It's not a valid use of Seam.