3 Replies Latest reply on Apr 10, 2009 3:53 AM by Walter White

    Null Pointer Exception with Seam Mail

    Walter White Novice

      Hi all,


      When trying to send an email, I get an exception reporting emailAddress is not a property of HashSet which is the class I'm using to hold all the recipients.


      <ui:repeat value="#{recipients}" var="recipient">
           <m:to name="#{recipient.name}" address="#{recipient.emailAddress}"/>
      </ui:repeat>
      



      javax.el.PropertyNotFoundException: /email/template/default.xhtml @10,72 address="#{recipient.emailAddress}": The class 'java.util.HashSet' does not have the property 'emailAddress'.
      



      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                          xmlns:ui="http://java.sun.com/jsf/facelets"
                          xmlns:s="http://jboss.com/products/seam/taglib"
                          xmlns:m="http://jboss.com/products/seam/mail"
                          xmlns:h="http://java.sun.com/jsf/html"
                          xmlns:f="http://java.sun.com/jsf/core">
           <m:message>
                <m:from name="Website Email" address="websiteEmail@something.com" />
                <ui:repeat value="#{recipients}" var="recipient">
                     <m:to name="#{recipient.name}" address="#{recipient.emailAddress}"/>
                </ui:repeat>
                <m:replyTo name="Website Email" address="websiteEmail@something.com"/>
      
                <m:subject>
                     <ui:insert name="subject"/>
                </m:subject>
                <m:body>
                     <ui:insert name="body"/>
                </m:body>
           </m:message>
      </ui:composition>
      



      I tried simply putting this into a separate message without using a template and I get the same error.  Is there anything special I need to do in order to pass a list of users into this email message?



      Thanks,
      Walter