3 Replies Latest reply on Oct 4, 2008 5:29 PM by Pete Muir

    BETA1: problems sending mail

    Miroslav Liska Newbie

      Switching from 2.0.2.SP1 to BETA1:


      code working in previous version now throws following exception when deployed with BETA1:



      00:17:39,682 ERROR [application] javax.ejb.EJBTransactionRolledbackException: Could not instantiate Seam component: org.jboss.seam.ui.facele
      t.facesContextFactory
      javax.faces.el.EvaluationException: javax.ejb.EJBTransactionRolledbackException: Could not instantiate Seam component: org.jboss.seam.ui.fac
      elet.facesContextFactory
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
              at javax.faces.component.UICommand.broadcast(UICommand.java:387)
              at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
              at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
              at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
              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 javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              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.IdentityFilter.doFilter(IdentityFilter.java:38)



      at the specified line, I am sending an email. This is NOT a MDB.



      Text of message:



      <m:message xmlns="http://www.w3.org/1999/xhtml"
           xmlns:m="http://jboss.com/products/seam/mail"
           xmlns:h="http://java.sun.com/jsf/html">
      
           <m:from name="example" address="some@example.com" />
           <m:to name="#{user.login}">#{user.email}</m:to>
           <m:subject><h:outputText value="Welcome #{user.login}" /></m:subject>
      
           <m:body>
           
                <p><h:outputText value="Dear #{user.login}" />,</p>
                <p><h:outputText value="Your login is : #{user.login}" />,</p>
                <p><h:outputText value="Your email is : #{user.newpass}" />,</p>
                <p>Have fun !! </p>
           
           </m:body>
      
      </m:message>




      This is how it is sent:



                // send welcome email
                try 
                {
                     this.renderer.render( "/mails/welcome.xhtml" );
                     this.facesMessages.add( "Welcome mail was sent" );
                }
                catch ( FacesException e )
                {
                     facesMessages.add( "Email sending failed: " + e.getMessage() );
                     this.corebase.error( e.getMessage(), Renderer.class );
                }
                
                // persist user
                this.entityManager.persist( user );
                this.entityManager.flush();



      from bean signed as:


      @Stateless
      @Name( "userCreator" )
      public class UserCreator implements UserCreatorLocal
      {
           @In 
           Identity identity;
           
           @In 
           FacesMessages facesMessages;
      
           @In(create=true)
           private Renderer renderer;
      
           @In(create=true)
           private User user;
      
           @PersistenceContext
           private EntityManager entityManager;
      



      can anyone help me please? i am really desperate :-)

        • 1. Re: BETA1: problems sending mail
          Miroslav Liska Newbie

          This is the exact line where exception is thrown:



          this.renderer.render( "/mails/welcome.xhtml" );


          • 2. Re: BETA1: problems sending mail
            Miroslav Liska Newbie

            I have simplilfied the message to eliminate any JSF to:



            <m:message xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:m="http://jboss.com/products/seam/mail">
            
                 <m:from name="somename" address="some@example.com" />
                 <m:to name="#{user.login}">#{user.email}</m:to>
                 <m:subject>Welcome #{user.login}</m:subject>
            
                 <m:body>
                 
                      <p>Dear #{user.login}</p>
                      <p>Your login is : #{user.login},</p>
                      <p>Your email is : #{user.newpass},</p>
                      <p>Have a fun </p>
                 
                 </m:body>
            
            </m:message>



            but I still get exception at line



            this.renderer.render( "/mails/welcome.xhtml" );



            As mentioned in my first post, this code worked perfectly in  2.0.2.SP1


            No SEAM DEVELOPER around to explain what has been changed in BETA1 ? I am looking at the examples, but don't see a difference.


            • 3. Re: BETA1: problems sending mail
              Pete Muir Master

              Please file an issue in JIRA with an example to reproduce.