Seam Mail Fails with "ICEfaces requires the PersistentFacesServlet" exception
[Logo]
Forums for ICEfaces and ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
Seam Mail Fails with "ICEfaces requires the PersistentFacesServlet" exception  XML
Forum Index -> JBoss Seam Integration Go to Page: Previous  1, 2
Author Message
zzzz8

Joined: 07/12/2005 00:00:00
Messages: 229
Offline


I get the following when sending a templated message:

Code:
01:22:49,779 ERROR [MailExample] Error sending mail
 java.lang.IllegalStateException: ICEfaces requires the PersistentFacesServlet. Please check your web.xml servlet mappings
 	at com.icesoft.faces.context.DOMResponseWriter.<init>(DOMResponseWriter.java:150)
 	at com.icesoft.faces.context.DOMContext.createTemporaryDOMResponseWriter(DOMContext.java:182)
 	at com.icesoft.faces.context.DOMContext.attachDOMContext(DOMContext.java:107)
 	at com.icesoft.faces.renderkit.dom_html_basic.TableRenderer.encodeBegin(TableRenderer.java:68)
 	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
 	at javax.faces.component.UIData.encodeBegin(UIData.java:962)
 	at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:172)
 	at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
 	at org.jboss.seam.mail.ui.MailComponent.encode(MailComponent.java:85)
 	at org.jboss.seam.mail.ui.MailComponent.encode(MailComponent.java:59)
 	at org.jboss.seam.mail.ui.UIBody.encodeChildren(UIBody.java:44)
 	at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:175)
 	at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
 	at org.jboss.seam.mail.ui.UIMessage.encodeChildren(UIMessage.java:192)
 	at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:175)
 	at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
 	at org.jboss.seam.ui.facelet.RendererRequest.renderFacelet(RendererRequest.java:136)
 	at org.jboss.seam.ui.facelet.RendererRequest.run(RendererRequest.java:103)
 	at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:43)
 	at org.jboss.seam.example.mail.MailExample.sendTemplate(MailExample.java:80)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 	at java.lang.reflect.Method.invoke(Method.java:585)
 	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
 	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
 	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 	at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
 	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
 	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
 	at org.jboss.seam.example.mail.MailExample_$$_javassist_seam_3.sendTemplate(MailExample_$$_javassist_seam_3.java)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 	at java.lang.reflect.Method.invoke(Method.java:585)
 	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
 	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
 	at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
 	at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
 	at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
 	at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
 	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
 	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
 	at javax.faces.component.UICommand.broadcast(UICommand.java:387)
 	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
 	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:755)
 	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
 	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
 	at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:16)
 	at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:114)
 	at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:66)
 	at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:28)
 	at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
 	at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
 	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:42)
 	at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
 	at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
 	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:62)
 	at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:22)
 	at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
 	at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:153)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 	at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
 	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.web.LoggingFilter.doFilter(LoggingFilter.java:58)
 	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
 	at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
 	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.IdentityFilter.doFilter(IdentityFilter.java:40)
 	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.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:182)
 	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(Thread.java:595)
 
zzzz8

Joined: 07/12/2005 00:00:00
Messages: 229
Offline


Hi Judy,

Do you have any idea what's going on with these errors? Thanks!
judy.guglielmin

Joined: 20/02/2007 00:00:00
Messages: 1043
Offline


This last stack trace is because the ExternalContext that is getting to the PersistentFAcesServlet is not a BridgeExternalContext. The other traces are not from ICEfaces (look like errors in your java.mail configuration).
zzzz8

Joined: 07/12/2005 00:00:00
Messages: 229
Offline


Hi Judy,

Thanks for the reply. I don't think it's an issue with my configuration because the email does get sent out when I have a mail template that does not include h:panelGrid. But when I add in h:panelGrid, the previous errors occur. Yes, the SpamHaus errors are a bit suspicious - but I can't seem to figure out why an email gets sent out without the h:panelGrid tags but fails to get sent out with the h:panelGrid tags.
judy.guglielmin

Joined: 20/02/2007 00:00:00
Messages: 1043
Offline


Do you have an id on the panelGrid and if so, do you get any reference to it in the server log exception trace?
zzzz8

Joined: 07/12/2005 00:00:00
Messages: 229
Offline


I did not put an ID for the panelGrid. I will put an ID and see if it shows up in my stack trace (shouldn't the generated ID show up in the trace though? - and it doesn't right now). I will give it a try. Thanks!
judy.guglielmin

Joined: 20/02/2007 00:00:00
Messages: 1043
Offline


another thing to try is just put a div (with an id) to see if it makes any difference. If you are using jsf-delegation, it is the jsf ViewHandler that is doing the rendering. If not, then you could be putting some debug in the D2DFaceletViewHandler. (I'd use jsf-delegation though).
zzzz8

Joined: 07/12/2005 00:00:00
Messages: 229
Offline


I'm getting a similar stack trace when I put an id for the panelGrid:

Code:
23:24:51,749 ERROR [AsynchronousExceptionHandler] Exeception thrown whilst executing asynchronous call
 java.lang.IllegalStateException: ICEfaces requires the PersistentFacesServlet. Please check your web.xml servlet mappings
 	at com.icesoft.faces.context.DOMResponseWriter.<init>(DOMResponseWriter.java:150)
 	at com.icesoft.faces.context.DOMContext.createTemporaryDOMResponseWriter(DOMContext.java:182)
 	at com.icesoft.faces.context.DOMContext.attachDOMContext(DOMContext.java:107)
 	at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeBegin(GridRenderer.java:60)
 	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
 	at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:172)
 	at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
 	at org.jboss.seam.mail.ui.MailComponent.encode(MailComponent.java:85)
 	at org.jboss.seam.mail.ui.MailComponent.encode(MailComponent.java:59)
 	at org.jboss.seam.mail.ui.UIBody.encodeChildren(UIBody.java:44)
 	at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:175)
 	at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
 	at org.jboss.seam.mail.ui.UIMessage.encodeChildren(UIMessage.java:192)
 	at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:175)
 	at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
 	at org.jboss.seam.ui.facelet.RendererRequest.renderFacelet(RendererRequest.java:136)
 	at org.jboss.seam.ui.facelet.RendererRequest.run(RendererRequest.java:103)
 	at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:43)
 	at com.myproject.async.ShoppinglistMailer.sendOnceMessage(ShoppinglistMailer.java:40)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 	at java.lang.reflect.Method.invoke(Method.java:585)
 	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
 	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
 	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 	at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 	at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
 	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
 	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
 	at com.myproject.async.ShoppinglistMailer_$$_javassist_seam_9.sendOnceMessage(ShoppinglistMailer_$$_javassist_seam_9.java)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 	at java.lang.reflect.Method.invoke(Method.java:585)
 	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
 	at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
 	at org.jboss.seam.async.AsynchronousInvocation$1.process(AsynchronousInvocation.java:62)
 	at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80)
 	at org.jboss.seam.async.AsynchronousInvocation.execute(AsynchronousInvocation.java:44)
 	at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:243)
 	at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
 	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
 
zzzz8

Joined: 07/12/2005 00:00:00
Messages: 229
Offline


If I replace panelGrid with div, the email gets sent. But obviously, I want the layout effect of the panelGrid though...
jguglielmin

Joined: 20/07/2007 00:00:00
Messages: 181
Offline


It looks like you are incorrectly trying to use jsf-delegation. The <m> tag pages should be devoid of any <ice> tags and using the regular jsf view handler if configured correctly (not trying to do the rendering at all since it will expect a BridgeExternalContext--which is what you are seeing). USing jsf-delegation correctly, the <h:> tags are rendered by standard jsf viewhandler and don't involve the PersistentFacesServlet.

If you are doing this by wrapping the contexts (without using jsf-delegation), then you have to ensure the Renderer wraps/unwraps the external context correctly.
zzzz8

Joined: 07/12/2005 00:00:00
Messages: 229
Offline


Hi Judy,

I assure you I'm not using any ICEfaces tags in the mail template. That's why this is so puzzling...
jguglielmin

Joined: 20/07/2007 00:00:00
Messages: 181
Offline


Then, if you are using jsf-delegation properly, the PersistentFacesServlet would not be rendering this page/view. (the FacesServlet would be). Did you trace through to see which was taking the render call from this particular page?
zzzz8

Joined: 07/12/2005 00:00:00
Messages: 229
Offline


I traced through using Eclipse. It didn't seem to be giving me the correct FacesServlet info (it didn't give me the actual implementing type) but it was using the FacesContextImpl for FacesContext. Does it by default use FacesServlet instead of PersistentFacesServlet?
jguglielmin

Joined: 20/07/2007 00:00:00
Messages: 181
Offline


Yes seam-mail, seam-pdf, etc all use the FacesServlet by default (which is why jsf-delegation works as the non-ice pages are then mapped to the standard jsf FacesServlet).
 
Forum Index -> JBoss Seam Integration Go to Page: Previous  1, 2
Go to:   
Powered by JForum 2.1.7ice © JForum Team