12 Replies Latest reply on Sep 3, 2007 7:44 AM by Martin Krajci

    Seam email problem

    Martin Krajci Newbie

      Hi all,

      I'm trying to send an email using seam, but with exception.

      Seam version: 1.2.1GA
      Jboss AS version: 4.2.1.GA
      JSF version 1.2 SUN RI

      I have:
      1) created mail-service.xml

      <mbean code="org.jboss.mail.MailService"
       name="jboss:service=CechieMailservice">
       <attribute name="JNDIName">java:/CechieMailService</attribute>
       <attribute name="User">martin.krajci</attribute>
       <attribute name="Password">mypwd</attribute>
       <attribute name="Configuration">
       <configuration>
       <property name="mail.store.protocol" value="pop3"/>
       <property name="mail.transport.protocol" value="smtp"/>
       <property name="mail.user" value="martin.krajci"/>
       <property name="mail.pop3.host" value="pop.gmail.com"/>
       <property name="mail.smtp.host" value="smtp.gmail.com"/>
       <property name="mail.smtp.port" value="465"/>
       <property name="mail.from" value="martin.krajci@gmail.com"/>
       <property name="mail.smtps.auth" value="true"/>
       <property name="mail.smtps.quitwait" value="false"/>
       <property name="mail.debug" value="true"/>
       </configuration>
       </attribute>
       <depends>jboss:service=Naming</depends>
       </mbean>


      2) edited components.xml

      <mail:mail-session session-jndi-name="java:/CechieMailService"/>

      or

      <mail:mail-session host="localhost" port="2525" username="test" password="test" />

      + namespaces in tag are the same as in seam mail example

      3) included jboss-seam-mail.jar in ear/war/WEB-INF/lib

      4) used seam mail example in my project

      But I got exception when sending email:

      13:17:33,448 INFO [MailSession] Creating JavaMail Session (localhost:null)
      13:17:33,458 INFO [MailSession] connected to mail server
      13:17:34,510 ERROR [ReservationComponent] Error sending mail
      javax.faces.FacesException: Exception reading response
      at org.jboss.seam.mail.ui.UIMessage.encodeEnd(UIMessage.java:142)
      at org.jboss.seam.ui.JSF.renderChild(JSF.java:180)
      at org.jboss.seam.ui.JSF.renderChildren(JSF.java:162)
      at org.jboss.seam.ui.facelet.FaceletsRenderer.renderFacelet(FaceletsRend
      erer.java:150)
      at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.ja
      va:112)
      at cz.krajci.cechie.business.logic.ReservationComponent.finishBooking(Re
      servationComponent.java:154)

      The strange thing is the (localhost:null) host and port.

      What else I'm missing?

      Thanx for any reply.

      Martin

        • 1. Re: Seam email problem
          fhh Expert

           

          <property name="mail.smtp.port" value="465"/>


          Is this secure SMTP? This is a highly unsual setting.

          I think before TLS could be initialized during the session the port was used for secure SMTP. Anyway since you are transfering to localhost port 25 should be fine.

          Regards

          Felix

          • 2. Re: Seam email problem
            Martin Krajci Newbie

            I dont't think the problem is in mail-service.xml. I have changed the values there many times. The problem is that seam somehow doesn't load the configuration from components.xml and set the host, port to default values that are in MailSession.java (localhost, null).

            Does enybody have idea why is this happening?

            <?xml version="1.0" encoding="UTF-8"?>
            <components xmlns="http://jboss.com/products/seam/components"
             xmlns:core="http://jboss.com/products/seam/core"
             xmlns:framework="http://jboss.com/products/seam/framework"
             xmlns:mail="http://jboss.com/products/seam/mail"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation=
             "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd
             http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd
             http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-1.2.xsd
             http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.2.xsd">
            
             <core:init jndi-pattern="@jndiPattern@"/>
             <core:ejb installed="@embeddedEjb@"/>
             <core:dispatcher />
            
            
             <!--
             <mail:mail-session host="localhost" port="2525" username="test" password="test" />
             -->
            
             <mail:mail-session session-jndi-name="java:/CechieMailService"/>
            
            </components>



            • 3. Re: Seam email problem
              Pete Muir Master

              Post the whole stacktrace and output of JavaMail debug. Does this work if you specify the STMP details in components.xml rather than using the MailService?

              • 4. Re: Seam email problem
                Martin Krajci Newbie

                Hi Pete,

                Thanx for helping me out. The whole stack trace is below. I'm getting the same exception in both cases:

                <mail:mail-session session-jndi-name="java:/CechieMailService" debug="true"/>
                
                 <mail:mail-session host="localhost" port="2525" username="test" password="test" />



                18:03:50,425 INFO [MailSession] Creating JavaMail Session (localhost:null)
                18:03:50,445 INFO [MailSession] connected to mail server
                18:03:53,049 ERROR [ReservationComponent] Error sending mail
                javax.faces.FacesException: Exception reading response
                at org.jboss.seam.mail.ui.UIMessage.encodeEnd(UIMessage.java:142)
                at org.jboss.seam.ui.JSF.renderChild(JSF.java:180)
                at org.jboss.seam.ui.JSF.renderChildren(JSF.java:162)
                at org.jboss.seam.ui.facelet.FaceletsRenderer.renderFacelet(FaceletsRend
                erer.java:150)
                at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.ja
                va:112)
                at cz.krajci.cechie.business.logic.ReservationComponent.finishBooking(Re
                servationComponent.java:164)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                sorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:112)
                at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo
                ntextImpl.java:166)
                at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationCo
                ntext.java:37)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                Context.java:57)
                at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(Bijecti
                onInterceptor.java:47)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                Context.java:69)
                at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundIn
                voke(ManagedEntityIdentityInterceptor.java:37)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                Context.java:69)
                at org.jboss.seam.interceptors.ConversationInterceptor.aroundInvoke(Conv
                ersationInterceptor.java:54)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                Context.java:69)
                at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(Met
                hodContextInterceptor.java:27)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                Context.java:69)
                at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:
                103)
                at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionB
                eanInterceptor.java:53)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                sorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo
                ntextImpl.java:118)
                at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3Int
                erceptorsInterceptor.java:63)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:101)
                at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationIntercepto
                r.invoke(ExtendedPersistenceContextPropagationInterceptor.java:71)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:101)
                at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invok
                e(TransactionScopedEntityManagerInterceptor.java:54)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:101)
                at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsI
                nterceptor.java:47)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:101)
                at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java
                :195)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:101)
                at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt
                erceptor.java:76)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:101)
                at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulIn
                stanceInterceptor.java:83)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:101)
                at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
                ationInterceptor.java:77)
                at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth
                enticationInterceptor.java:106)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:101)
                at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
                ptor.java:46)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:101)
                at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
                usInterceptor.java:106)
                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                java:101)
                at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContain
                er.java:204)
                at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.
                java:100)
                at $Proxy257.finishBooking(Unknown Source)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                sorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
                at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocation
                Context.java:31)
                at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideIn
                terceptor.java:72)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                Context.java:57)
                at org.jboss.seam.interceptors.RemoveInterceptor.aroundInvoke(RemoveInte
                rceptor.java:40)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                Context.java:69)
                at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:
                103)
                at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInter
                ceptor.java:50)
                at org.javassist.tmp.java.lang.Object_$$_javassist_69.finishBooking(Obje
                ct_$$_javassist_69.java)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                sorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
                at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:2
                76)
                at org.jboss.seam.ui.facelet.MethodExpressionHelper.invokeTheExpression(
                MethodExpressionHelper.java:102)
                at org.jboss.seam.ui.facelet.ParamMethodExpression.invoke(ParamMethodExp
                ression.java:62)
                at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.ja
                va:68)
                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(Met
                hodBindingMethodExpressionAdapter.java:77)
                at com.sun.faces.application.ActionListenerImpl.processAction(ActionList
                enerImpl.java:91)
                at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.j
                ava:180)
                at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot
                .java:158)
                at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewR
                oot.java:346)
                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicat
                ionPhase.java:97)
                at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                icationFilterChain.java:290)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                ilterChain.java:206)
                at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                icationFilterChain.java:235)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                ilterChain.java:206)
                at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseX
                MLFilter.java:127)
                at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.
                java:277)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                icationFilterChain.java:235)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                ilterChain.java:206)
                at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
                lter.java:96)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                icationFilterChain.java:235)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                ilterChain.java:206)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
                alve.java:230)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
                alve.java:175)
                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
                yAssociationValve.java:179)
                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
                torBase.java:433)
                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
                e.java:84)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
                ava:128)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
                ava:104)
                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
                onnectionValve.java:157)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
                ve.java:109)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
                a:241)
                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
                :844)
                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
                ss(Http11Protocol.java:580)
                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
                7)
                at java.lang.Thread.run(Thread.java:595)
                Caused by: javax.mail.MessagingException: Exception reading response;
                nested exception is:
                java.net.SocketException: Connection reset
                at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java
                :1462)
                at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260)
                at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:37
                0)
                at javax.mail.Service.connect(Service.java:275)
                at javax.mail.Service.connect(Service.java:156)
                at javax.mail.Service.connect(Service.java:105)
                at org.jboss.seam.mail.ui.UIMessage.encodeEnd(UIMessage.java:136)
                ... 111 more
                Caused by: java.net.SocketException: Connection reset
                at java.net.SocketInputStream.read(SocketInputStream.java:168)
                at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97)
                at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
                at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
                at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)
                at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java
                :1440)
                ... 117 more

                • 5. Re: Seam email problem
                  Pete Muir Master

                  Use the settings you have for CechieMailService in components.xml

                  • 6. Re: Seam email problem
                    Martin Krajci Newbie

                    I have of cource done that with many different values. Notning helped. I think I will give up on Seam email support and integrate Seam with Spring and send the mail with Spring bean.

                    If you have any more ideas please let me know I will try all of them.

                    • 7. Re: Seam email problem
                      Pete Muir Master

                      This in components.xml

                      <mail:mail-session host="smtp.gmail.com" port="465" username="xxxx" password="xxxx" ssl="true" />


                      works for me with Seam 1.2.1.GA and gmail. Try this, and post the exact, full exception that you get.

                      • 8. Re: Seam email problem
                        Pete Muir Master

                        Have you checked you have no firewall blocking connections?

                        • 9. Re: Seam email problem
                          Martin Krajci Newbie

                          I have tried your configuration.

                          <?xml version="1.0" encoding="UTF-8"?>
                          <components xmlns="http://jboss.com/products/seam/components"
                           xmlns:core="http://jboss.com/products/seam/core"
                           xmlns:framework="http://jboss.com/products/seam/framework"
                           xmlns:mail="http://jboss.com/products/seam/mail"
                           xmlns:spring="http://jboss.com/products/seam/spring"
                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                           xsi:schemaLocation=
                           "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd
                           http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd
                           http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-1.2.xsd
                           http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.2.xsd
                           http://jboss.com/products/seam/spring http://jboss.com/products/seam/spring-1.2.xsd">
                          
                           <core:init jndi-pattern="@jndiPattern@"/>
                           <core:ejb installed="@embeddedEjb@"/>
                           <core:dispatcher />
                          
                           <component name="org.jboss.seam.core.manager">
                           <!-- half second wait for conversation lock on concurrent requests -->
                           <property name="concurrentRequestTimeout">500</property>
                           <!-- 20 minutes conversation timeout -->
                           <property name="conversationTimeout">1200000</property>
                           <property name="conversationIdParameter">cid</property>
                           <property name="conversationIsLongRunningParameter">clr</property>
                           </component>
                          
                           <spring:context-loader />
                          
                          
                           <mail:mail-session host="smtp.gmail.com" port="465" username="martin.krajci" password="xxx" ssl="true"/>
                          
                           <!--
                           <mail:mail-session host="localhost" port="2525" username="test" password="test" />
                           <mail:mail-session session-jndi-name="java:/CechieMailService" debug="true"/>
                           -->
                          
                          </components>


                          I also tried to turn off the windows firewall, but the exception is still the same:

                          12:05:08,210 INFO [MailSession] Creating JavaMail Session (localhost:null)
                          12:05:08,220 INFO [MailSession] connected to mail server
                          12:05:09,242 ERROR [ReservationComponent] Error sending mail
                          javax.faces.FacesException: Exception reading response
                          at org.jboss.seam.mail.ui.UIMessage.encodeEnd(UIMessage.java:142)
                          at org.jboss.seam.ui.JSF.renderChild(JSF.java:180)
                          at org.jboss.seam.ui.JSF.renderChildren(JSF.java:162)
                          at org.jboss.seam.ui.facelet.FaceletsRenderer.renderFacelet(FaceletsRend
                          erer.java:150)
                          at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.ja
                          va:112)
                          at cz.krajci.cechie.business.logic.ReservationComponent.finishBooking(Re
                          servationComponent.java:158)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                          java:39)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                          sorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:585)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:112)
                          at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo
                          ntextImpl.java:166)
                          at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationCo
                          ntext.java:37)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                          Context.java:57)
                          at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(Bijecti
                          onInterceptor.java:47)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                          Context.java:69)
                          at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundIn
                          voke(ManagedEntityIdentityInterceptor.java:37)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                          Context.java:69)
                          at org.jboss.seam.interceptors.ConversationInterceptor.aroundInvoke(Conv
                          ersationInterceptor.java:54)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                          Context.java:69)
                          at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(Met
                          hodContextInterceptor.java:27)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                          Context.java:69)
                          at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:
                          103)
                          at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionB
                          eanInterceptor.java:53)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                          java:39)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                          sorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:585)
                          at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo
                          ntextImpl.java:118)
                          at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3Int
                          erceptorsInterceptor.java:63)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:101)
                          at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationIntercepto
                          r.invoke(ExtendedPersistenceContextPropagationInterceptor.java:71)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:101)
                          at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invok
                          e(TransactionScopedEntityManagerInterceptor.java:54)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:101)
                          at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsI
                          nterceptor.java:47)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:101)
                          at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                          at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java
                          :195)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:101)
                          at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt
                          erceptor.java:76)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:101)
                          at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulIn
                          stanceInterceptor.java:83)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:101)
                          at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
                          ationInterceptor.java:77)
                          at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth
                          enticationInterceptor.java:106)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:101)
                          at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
                          ptor.java:46)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:101)
                          at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
                          usInterceptor.java:106)
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                          java:101)
                          at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContain
                          er.java:204)
                          at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.
                          java:100)
                          at $Proxy154.finishBooking(Unknown Source)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                          java:39)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                          sorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:585)
                          at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
                          at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocation
                          Context.java:31)
                          at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideIn
                          terceptor.java:72)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                          Context.java:57)
                          at org.jboss.seam.interceptors.RemoveInterceptor.aroundInvoke(RemoveInte
                          rceptor.java:40)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                          Context.java:69)
                          at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:
                          103)
                          at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInter
                          ceptor.java:50)
                          at org.javassist.tmp.java.lang.Object_$$_javassist_28.finishBooking(Obje
                          ct_$$_javassist_28.java)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                          java:39)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                          sorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:585)
                          at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
                          at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:2
                          76)
                          at org.jboss.seam.ui.facelet.MethodExpressionHelper.invokeTheExpression(
                          MethodExpressionHelper.java:102)
                          at org.jboss.seam.ui.facelet.ParamMethodExpression.invoke(ParamMethodExp
                          ression.java:62)
                          at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.ja
                          va:68)
                          at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(Met
                          hodBindingMethodExpressionAdapter.java:77)
                          at com.sun.faces.application.ActionListenerImpl.processAction(ActionList
                          enerImpl.java:91)
                          at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                          at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.j
                          ava:180)
                          at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot
                          .java:158)
                          at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewR
                          oot.java:346)
                          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicat
                          ionPhase.java:97)
                          at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)

                          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                          icationFilterChain.java:290)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                          ilterChain.java:206)
                          at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                          icationFilterChain.java:235)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                          ilterChain.java:206)
                          at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseX
                          MLFilter.java:127)
                          at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.
                          java:277)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                          icationFilterChain.java:235)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                          ilterChain.java:206)
                          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
                          lter.java:96)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                          icationFilterChain.java:235)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                          ilterChain.java:206)
                          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
                          alve.java:230)
                          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
                          alve.java:175)
                          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
                          yAssociationValve.java:179)
                          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
                          torBase.java:433)
                          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
                          e.java:84)
                          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
                          ava:128)
                          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
                          ava:104)
                          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
                          onnectionValve.java:157)
                          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
                          ve.java:109)
                          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
                          a:241)
                          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
                          :844)
                          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
                          ss(Http11Protocol.java:580)
                          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
                          7)
                          at java.lang.Thread.run(Thread.java:595)
                          Caused by: javax.mail.MessagingException: Exception reading response;
                          nested exception is:
                          java.net.SocketException: Connection reset
                          at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java
                          :1462)
                          at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260)
                          at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:37
                          0)
                          at javax.mail.Service.connect(Service.java:275)
                          at javax.mail.Service.connect(Service.java:156)
                          at javax.mail.Service.connect(Service.java:105)
                          at org.jboss.seam.mail.ui.UIMessage.encodeEnd(UIMessage.java:136)
                          ... 111 more
                          Caused by: java.net.SocketException: Connection reset
                          at java.net.SocketInputStream.read(SocketInputStream.java:168)
                          at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97)
                          at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
                          at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
                          at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)
                          at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java
                          :1440)
                          ... 117 more

                          I'm still suspecting seam that it doesn't read the components.xml correctly, because spring:context-loader doesn't load the applicationContext.xml either even I have configured everything like in the example. But this is different problem. Please let us focus on the email one.

                          If you have not run out of ideas please let me know.

                          Thanx.

                          Martin

                          • 10. Re: Seam email problem
                            Pete Muir Master

                            Yes, it does look like your components.xml isn't being read correctly - it should now display

                            12:05:08,210 INFO [MailSession] Creating JavaMail Session (smtp.gmail.com:465)


                            (the problem with the session-jndi-name approach is that control of the mail session is no longer in Seam and so I don't know the debug output as well ;) ) .

                            You should turn on debug for JavaMail in components.xml anyway

                            <mail:mail-session host="smtp.gmail.com" port="465" username="martin.krajci" password="xxx" ssl="true" debug="true"/>


                            It's very obvious when debug is turned on - lots of stuff is spewed to the console.

                            So, check that your components.xml has been placed in war/WEB-INF/components.xml in your deployed project.

                            • 11. Re: Seam email problem
                              Martin Krajci Newbie

                              My components.xml is in ear/war/WEB-INF. The debug="true" doesn't help because the componenet has not been read. I have changed the source of seam MailSender.java

                              private String sessionJndiName = "java:/Mail";
                              
                               @Create
                               public void create() throws NamingException
                               {
                               if ( getSessionJndiName()==null )
                               {
                               createSession();
                               } else {
                               session = (Session) Naming.getInitialContext().lookup( getSessionJndiName() );
                               }
                               }


                              and now the email is send.

                              This is quite Hack, but I have run out of correct ideas.

                              • 12. Re: Seam email problem
                                Martin Krajci Newbie

                                The changed source is MailSession.java (not MailSender.java).