Seam 2.3.0 with icefaces 3.2 exception when rendering email
cyberoblivion Aug 16, 2013 8:16 AMI have a simple xhtml page
<m:message xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://jboss.org/schema/seam/mail" xmlns:h="http://java.sun.com/jsf/html"> <m:from name="Peter" address="peter@example.com" /> <m:to name="jim@example.com" >jim@example.com</m:to> <m:subject>Try out Seam!</m:subject> <m:body> <p><h:outputText value="Dear #{person.firstname}" />,</p> <p>You can try out Seam by visiting <a href="http://labs.jboss.com/jbossseam">http://labs.jboss.com/jbossseam</a>.</p> <p>Regards,</p> <p>Pete</p> </m:body> </m:message>
I try to send it using
public void sendTestEmail() { try { Renderer.instance().render("/admin/useradmin/testEmail.xhtml"); JsfUtils.addInfoMessage("Email sent successfully"); } catch (Exception e) { JsfUtils.addErrorMessage("Email sending failed: " + e.getMessage()); log.error("Email sending failed: ", e); } }
but I get an exception in the Renderer.instance().render method
Exception:
at org.icefaces.impl.context.DOMResponseWriter.appendToCursor(DOMResponseWriter.java:395)
at org.icefaces.impl.context.DOMResponseWriter.writeText(DOMResponseWriter.java:344)
at org.jboss.seam.mail.ui.context.MailResponseWriter.writeText(MailResponseWriter.java:181)
at com.sun.faces.facelets.compiler.LiteralTextInstruction.write(LiteralTextInstruction.java:76)
at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
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:44)
at org.jboss.seam.mail.ui.AddressComponent.getInternetAddress(AddressComponent.java:28)
at org.jboss.seam.mail.ui.RecipientAddressComponent.encodeBegin(RecipientAddressComponent.java:25)
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.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:138)
at org.jboss.seam.ui.facelet.RendererRequest.run(RendererRequest.java:106)
at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:43)
at com.ciminc.compass.navigator.admin.comps.UserAdmin.sendTestEmail(UserAdmin.java:101)
I have looked in the appropriate icefaces javacode. and there are variable obviously expecting to not be null at this point.
here the code snippet from org.icefaces.impl.context.DOMResponseWriter
private Node appendToCursor(String data) { if (cursor == null) { Element doc = document.getDocumentElement();
both cursor and document are null when excecution reaches this point.
This used to work in icefaces 1.8.2 and seam 2.2.2.
My question is why is icefaces even trying to render this content as I have no reference to any icefaces components on this page. Also is there any configuration I can do to avoid this issue?
Any work arounds or suggestions are appreciated.
The workaround I came up with is now attached