0 Replies Latest reply on Dec 10, 2009 12:00 PM by Natalie D

    Sending mail: "Error reading 'instance'"

    Natalie D Newbie

      Hello,


      I'm trying to send mail and I need to fetch a body of a letter from a database. The database-talking object extends EntityHome:


      @Name("letterHome")
      public class LetterHome extends *EntityHome<Letter>*
      {
       ...
      }



      The Letter entity has the body field.


      It's OK when the value of this field is retrieved anywhere in the project but the page which is intended to send mail:


      <m:message xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:m="http://jboss.com/products/seam/mail"
                 xmlns:s="http://jboss.com/products/seam/taglib">
          
           <m:from name="Компания бюрократов" address="emanemos.stuff@gmail.com" />
          <m:to name="Наташа Данилина">emanemos.home@gmail.com</m:to>
          <m:subject>Just another test letter</m:subject>
          <m:body>
               <html>
                   <body>
                     <s:formattedText value="#{letterHome.instance.body}"/>
                </body>
               </html>
          </m:body>
      </m:message>



      Here's the method used to send mail:


      public void send() {
          try {
              renderer.render("/readyletter.xhtml");
              facesMessages.add("Successfully sent");
          } catch (Exception e) {
              facesMessages.add(FacesMessage.SEVERITY_INFO, "Mail sending fail: " + e.getMessage());
          }
      }



      And finally the error message it throws:


      Mail sending fail: javax.el.ELException: /readyletter.xhtml @10,58 value="<p>blah-blah</p>": Error reading 'instance' on type org.emanemos.mailbox.session.LetterHome_$$_javassist_seam_3
      


      I would be grateful if anybody could explain how to deal with this problem.