[jboss-user] [JBoss Seam] - Re: entityManager goes null on form submit?

wesleyhales do-not-reply at jboss.com
Mon Aug 13 10:55:27 EDT 2007


ERROR 13-08 10:44:39,394 (ContextualHttpServletRequest.java:run:66)  -ended request due to exception
  | java.lang.IllegalStateException: No active event context
  |   at org.jboss.seam.core.Manager.instance(Manager.java:248)
  |   at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:48)
  |   at com.autotrader.filter.RendererFilter.doFilter(RendererFilter.java:69)
  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  |   at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:253)
  |   at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:210)
  |   at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:164)
  |   at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:82)
  |   at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
  |   at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
  |   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
  |   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.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
  |   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
  |   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  |   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
  |   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
  |   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
  |   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
  |   at java.lang.Thread.run(Thread.java:595)
  | ERROR 13-08 10:44:39,394 (ExceptionFilter.java:doFilter:68)  -handling uncaught exception
  | javax.servlet.ServletException: java.lang.IllegalStateException: No active event context
  |   at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:67)
  |   at com.autotrader.filter.RendererFilter.doFilter(RendererFilter.java:69)
  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  |   at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:253)
  |   at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:210)
  |   at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:164)
  |   at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:82)
  |   at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
  |   at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
  |   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
  |   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.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
  |   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
  |   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  |   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
  |   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
  |   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
  |   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
  |   at java.lang.Thread.run(Thread.java:595)
  | Caused by: java.lang.IllegalStateException: No active event context
  |   at org.jboss.seam.core.Manager.instance(Manager.java:248)
  |   at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:48)
  |   ... 37 more
  | ERROR 13-08 10:44:39,554 (ExceptionFilter.java:doFilter:69)  -exception root cause
  | java.lang.IllegalStateException: No active event context
  |   at org.jboss.seam.core.Manager.instance(Manager.java:248)
  |   at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:48)
  |   at com.autotrader.filter.RendererFilter.doFilter(RendererFilter.java:69)
  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  |   at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:253)
  |   at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:210)
  |   at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:164)
  |   at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:82)
  |   at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
  |   at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
  |   at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
  |   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
  |   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
  |   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.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
  |   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
  |   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  |   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
  |   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
  |   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
  |   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
  |   at java.lang.Thread.run(Thread.java:595)

and here is my filter code

@Scope(APPLICATION)
  | @BypassInterceptors
  | @Filter(within="org.jboss.seam.web.ajax4jsfFilter")
  | public class RendererFilter extends AbstractFilter {
  | 
  |     FilterConfig config;
  |     private DocumentBuilder documentBuilder;
  |     private static String CLASS_NAME = RendererFilter.class.getName();
  |     Logger log = Logger.getLogger(CLASS_NAME);
  | 
  |     public void init(FilterConfig config) throws ServletException {
  |         try {
  |             this.config = config;
  |             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  |             documentBuilder = factory.newDocumentBuilder();
  |         } catch (ParserConfigurationException e) {
  |             throw new ServletException(e);
  |         }
  |     }
  | 
  | 
  |     public void doFilter(final ServletRequest request, final ServletResponse response,
  |                          final FilterChain chain) throws IOException, ServletException {
  | 
  |         new ContextualHttpServletRequest((HttpServletRequest) request) {
  |             @Override
  |             public void process() throws ServletException, IOException {
  |                 HttpServletRequest req = (HttpServletRequest) request;
  |                 HttpServletResponse resp = (HttpServletResponse) response;
  | 
  |                 //Check to see if this filter should apply.
  |                 String renderType = request.getParameter("RenderOutputType");
  |                 if (renderType != null) {
  |                     //Capture the content for this request
  |                     ContentCaptureServletResponse capContent = new ContentCaptureServletResponse(resp);
  |                     chain.doFilter(request, capContent);
  | 
  |                     try {
  |                         //Parse the XHTML content to a document that is readable by the XHTML renderer.
  |                         ...
  |                             renderer.createPDF(browserStream);
  |                             return;
  |                         }
  | 
  |                     } catch (SAXException e) {
  |                         throw new ServletException(e);
  |                     } catch (DocumentException e) {
  |                         throw new ServletException(e);
  |                     }
  | 
  | 
  |                 } else {
  |                     //Normal processing
  |                     chain.doFilter(request, response);
  |                 }
  | 
  |             }
  |         }.run();
  | 
  | 
  |     }
  | 
  | 
  |     public void destroy() {
  |     }
  | }
  | 
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073594#4073594

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073594



More information about the jboss-user mailing list