9 Replies Latest reply on Feb 12, 2007 9:22 AM by Pete Muir

    Need some help with Seam Email

    Bradley Smith Master

      In my components.xml, I have the following:

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


      and in fact, there is a javax.mail.Session bound to this name in JNDI (here's a partial dump from the JMX Console in JBoss:

      java: Namespace
      
       +- jaas (class: javax.naming.Context)
       | +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
       | +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
       +- SonicJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
       +- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
       +- SecureTopicConnectionFactory (class: progress.message.jclient.TopicConnectionFactory)
       +- comp.ejb3 (class: javax.naming.Context)
       | NonContext: null
       +- TopicConnectionFactory (class: progress.message.jclient.TopicConnectionFactory)
       +- XAQueueConnectionFactory (class: progress.message.jclient.xa.XAQueueConnectionFactory)
       +- appssoDB.MySQL (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
       +- jpblogDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
       +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
       +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
       +- TransactionManager (class: org.jboss.tm.TxManager)
       +- accessControlJBPMSessionFactory (class: org.hibernate.impl.SessionFactoryImpl)
       +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
       +- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
       +- XATopicConnectionFactory (class: progress.message.jclient.xa.XATopicConnectionFactory)
       +- OracleDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
       +- PortalDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
       +- SecureQueueConnectionFactory (class: progress.message.jclient.QueueConnectionFactory)
       +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
       +- SecureXAQueueConnectionFactory (class: progress.message.jclient.xa.XAQueueConnectionFactory)
       +- Mail (class: javax.mail.Session)
      
      


      I've been successfully using this JavaMail Session in my code via the @Resource annotation. I am trying to convert over to Seam email - here is a method that is based on the sample in the documentation:

       public void sendSeamEmail() {
       try {
       renderer.render("mail/email-template-sample.xhtml");
       log.info("Email sent successfully.");
      
       } catch (Exception e) {
       log.error(e,e);
       }
       }
      


      I've hooked this up a button in a page - when I click the button, I get the following exception:

      14:50:31,328 ERROR [MailSenderBean] javax.faces.FacesException: Sending failed;
       nested exception is:
       class javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
       nested exception is:
       java.net.ConnectException: Connection refused: connect
      javax.faces.FacesException: Sending failed;
       nested exception is:
       class javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
       nested exception is:
       java.net.ConnectException: Connection refused: connect
       at org.jboss.seam.mail.ui.UIMessage.encodeEnd(UIMessage.java:112)
       at org.jboss.seam.ui.JSF.renderChild(JSF.java:179)
       at org.jboss.seam.ui.JSF.renderChildren(JSF.java:162)
       at org.jboss.seam.ui.facelet.FaceletsRenderer.renderFacelet(FaceletsRenderer.java:106)
       at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:54)
       at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:38)
       at com.evergreen.accesscontrol.impl.MailSenderBean.sendSeamEmail(MailSenderBean.java:165)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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(InvocationContextImpl.java:166)
       at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
       at org.jboss.seam.interceptors.BijectionInterceptor.bijectNonreentrantComponent(BijectionInterceptor.java:79)
       at org.jboss.seam.interceptors.BijectionInterceptor.bijectComponent(BijectionInterceptor.java:58)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:52)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:51)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
       at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
       at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.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:201)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
       at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
       at $Proxy408.sendSeamEmail(Unknown Source)
       at com.evergreen.accesscontrol.MailSender$$FastClassByCGLIB$$8991d937.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
       at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:74)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
       at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
       at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
       at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:83)
       at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:52)
       at com.evergreen.accesscontrol.MailSender$$EnhancerByCGLIB$$6def53cd.sendSeamEmail(<generated>)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
       at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
       at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
       at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
       at javax.faces.component.UICommand.broadcast(UICommand.java:106)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
       at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.evergreen.filter.RequestDumper.doFilter(RequestDumper.java:78)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at com.evergreen.fastpass.catalina.CASSSOAuthenticatorValve.invoke(CASSSOAuthenticatorValve.java:373)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.mail.SendFailedException: Sending failed;
       nested exception is:
       class javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
       nested exception is:
       java.net.ConnectException: Connection refused: connect
       at javax.mail.Transport.send0(Transport.java:218)
       at javax.mail.Transport.send(Transport.java:80)
       at org.jboss.seam.mail.ui.UIMessage.encodeEnd(UIMessage.java:108)
       ... 146 more
      


      So what is happening here? it looks like the mail component in components.xml is not using the JavaMail Session in JNDI?

      Thanks,
      Brad Smith

        • 1. Re: Need some help with Seam Email
          Pete Muir Master

          I don't think this is the problem, but just to eliminate:

          Please post your $JBOSS_HOME/server/default/deploy/mail-service.xml and make sure you have the mail namespace declared in components.xml.

          What version of Seam is this?

          Otherwise, can you attach your debugger to the getSession method in MailSession and take a look to see if it's using the session from JNDI or a Seam managed session.

          • 2. Re: Need some help with Seam Email
            Bradley Smith Master

            Some more data from the deploy trace:

            19:30:04,234 INFO [ServletContextListener] Welcome to Seam 1.1.6.GA
            19:30:04,250 INFO [Initialization] Namespace: http://jboss.com/products/seam/core, package: org.jboss.seam.core, prefix: org.jboss.seam.core
            19:30:04,265 INFO [Initialization] Namespace: http://jboss.com/products/seam/framework, package: org.jboss.seam.framework, prefix: org.jboss.seam.core.framework
            19:30:04,265 INFO [Initialization] Namespace: http://jboss.com/products/seam/jms, package: org.jboss.seam.jms, prefix: org.jboss.seam.jms
            19:30:04,265 INFO [Initialization] Namespace: http://jboss.com/products/seam/drools, package: org.jboss.seam.drools, prefix: org.jboss.seam.drools
            19:30:04,265 INFO [Initialization] Namespace: http://jboss.com/products/seam/remoting, package: org.jboss.seam.remoting, prefix: org.jboss.seam.remoting
            19:30:04,265 INFO [Initialization] Namespace: http://jboss.com/products/seam/theme, package: org.jboss.seam.theme, prefix: org.jboss.seam.theme
            19:30:04,265 INFO [Scanner] scanning: /C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/access-control-ejbs-1.0.jar
            19:30:04,265 INFO [Scanner] scanning: /C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/jboss-seam-mail-1.1.6.jar
            19:30:04,281 INFO [Scanner] scanning: /C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/jboss-seam-ui-1.1.6.jar
            19:30:04,281 INFO [Scanner] scanning: C:\jboss-4.0.4.EJB.3RC8\server\default\tmp\deploy\tmp5440access-control-1.0.ear-contents\access-control-webapp-1.0-exp.war\WEB-INF\classes
            19:30:04,281 INFO [Scanner] scanning: /C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/access-control-webapp-1.0-exp.war/WEB-INF/lib/jboss-seam-
            ui-1.1.6.jar
            19:30:04,281 INFO [Initialization] Namespace: http://jboss.com/products/seam/mail, package: org.jboss.seam.mail, prefix: org.jboss.seam.mail
            19:30:04,296 INFO [Scanner] scanning: /C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/jboss-seam-1.1.6.jar
            19:30:04,312 INFO [Initialization] Namespace: http://jboss.com/products/seam/security, package: org.jboss.seam.security, prefix: org.jboss.seam.security
            19:30:04,312 INFO [Initialization] Namespace: http://jboss.com/products/seam/drools, package: org.jboss.seam.drools, prefix: org.jboss.seam.drools
            19:30:04,312 INFO [Initialization] Namespace: http://jboss.com/products/seam/remoting, package: org.jboss.seam.remoting, prefix: org.jboss.seam.remoting
            19:30:04,312 INFO [Initialization] Namespace: http://jboss.com/products/seam/theme, package: org.jboss.seam.theme, prefix: org.jboss.seam.theme
            19:30:04,312 INFO [Initialization] Namespace: http://jboss.com/products/seam/core, package: org.jboss.seam.core, prefix: org.jboss.seam.core
            19:30:04,312 INFO [Initialization] Namespace: http://jboss.com/products/seam/jms, package: org.jboss.seam.jms, prefix: org.jboss.seam.jms
            19:30:04,312 INFO [Initialization] Namespace: http://jboss.com/products/seam/framework, package: org.jboss.seam.framework, prefix: org.jboss.seam.core.framework
            19:30:04,312 INFO [Initialization] reading /WEB-INF/components.xml
            19:30:04,359 INFO [Initialization] reading jar:file:/C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/jboss-seam-1.1.6.jar!/META-INF/components.x
            ml
            19:30:04,375 INFO [Initialization] reading properties from: /seam.properties
            19:30:04,375 INFO [Initialization] reading properties from: /jndi.properties
            19:30:04,375 INFO [Initialization] initializing Seam
            19:30:04,375 INFO [Scanner] scanning: /C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/access-control-ejbs-1.0.jar
            19:30:04,718 INFO [Scanner] scanning: /C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/jboss-seam-mail-1.1.6.jar
            19:30:04,765 INFO [Scanner] scanning: /C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/jboss-seam-ui-1.1.6.jar
            19:30:04,890 INFO [Scanner] scanning: C:\jboss-4.0.4.EJB.3RC8\server\default\tmp\deploy\tmp5440access-control-1.0.ear-contents\access-control-webapp-1.0-exp.war\WEB-INF\classes
            19:30:04,937 INFO [Scanner] scanning: /C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/access-control-webapp-1.0-exp.war/WEB-INF/lib/jboss-seam-
            ui-1.1.6.jar
            19:30:05,031 INFO [Scanner] scanning: /C:/jboss-4.0.4.EJB.3RC8/server/default/tmp/deploy/tmp5440access-control-1.0.ear-contents/jboss-seam-1.1.6.jar
            19:30:06,484 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.jms.queueConnection
            19:30:06,500 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.pages
            19:30:06,515 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.manager
            19:30:06,515 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.mail.mailSession
            19:30:06,531 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.persistence.persistenceProvider
            19:30:06,562 INFO [Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
            19:30:06,578 INFO [Initialization] Installing components...
            19:30:06,578 INFO [Component] Component: org.jboss.seam.core.applicationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ApplicationContext
            19:30:06,578 INFO [Component] Component: org.jboss.seam.core.conversationStack, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationStack
            ...
            ...
            ...
            


            the message about "[Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.pages" is a bit strange.

            here is my components.xml:

            <?xml version="1.0" encoding="UTF-8"?>
            <components xmlns="http://jboss.com/products/seam/components"
             xmlns:core="http://jboss.com/products/seam/core"
             xmlns:mail="http://jboss.com/products/seam/mail"
             xmlns:components="http://jboss.com/products/seam/components"
             xmlns:framework="http://jboss.com/products/seam/framework"
             xmlns:jms="http://jboss.com/products/seam/jms"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation=
             "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
             http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd
             http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-1.1.xsd
             http://jboss.com/products/seam/jms http://jboss.com/products/seam/jms-1.1.xsd
             http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.1.xsd">
            
             <core:init jndi-pattern="access-control-1.0/#{ejbName}/local" debug="true"/>
            
             <mail:mail-session jndi-name="java:/Mail"/>
            
             <!-- 1500 second conversation timeout (for long running tests) -->
             <core:manager conversation-timeout="1800000"/>
            
             <core:pages no-conversation-view-id="/index.xhtml">
            
             </core:pages>
            
             <!-- jBPM Component configuration -->
             <core:jbpm>
             <core:process-definitions>
             <value>processdefinition.xml</value>
             </core:process-definitions>
             </core:jbpm>
            
             <core:managed-persistence-context
             name="accessControlDatabase"
             persistence-unit-jndi-name="java:/EntityManagerFactories/accessControlDatabase"/>
            
             <!-- Queue Connection Factory -->
             <jms:queue-connection queue-connection-factory-jndi-name="java:/QueueConnectionFactory"/>
            
             <!-- Queue(s) -->
             <jms:managed-queue-sender name="evergreenSecurityQueue" auto-create="true"
             queue-jndi-name="java:/SonicJMS/Queues/AccessControlAdaptor/EvergreenSecurity"/>
            
             <!-- Queue(s) -->
             <jms:managed-queue-sender name="accessControlReceiveQueue" auto-create="true"
             queue-jndi-name="java:/SonicJMS/Queues/AccessControl/Receive"/>
            
             <jms:managed-queue-sender name="test1sendQ" auto-create="true"
             queue-jndi-name="java:/SonicJMS/Queues/Test1/Send"/>
            
             <jms:managed-queue-sender name="test2sendQ" auto-create="true"
             queue-jndi-name="java:/SonicJMS/Queues/Test2/Send"/>
            
            </components>
            
            


            and here is my mail-service.xml:

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE server>
            <!-- $Id: mail-service.xml,v 1.5.6.1 2005/06/01 06:20:43 starksm Exp $ -->
            
            <server>
            
             <!-- ==================================================================== -->
             <!-- Mail Connection Factory -->
             <!-- ==================================================================== -->
            
             <mbean code="org.jboss.mail.MailService"
             name="jboss:service=Mail">
             <attribute name="JNDIName">java:/Mail</attribute>
             <attribute name="User"></attribute>
             <attribute name="Password"></attribute>
             <attribute name="Configuration">
             <!-- Test -->
             <configuration>
             <!-- Change to your mail server prototocol -->
             <!--property name="mail.store.protocol" value="pop3"/-->
             <property name="mail.transport.protocol" value="smtp"/>
            
             <!-- Change to the user who will receive mail -->
             <!--property name="mail.user" value="nobody"/-->
            
             <!-- Change to the mail server -->
             <!--property name="mail.pop3.host" value="pop3.nosuchhost.nosuchdomain.com"/-->
            
             <!-- Change to the SMTP gateway server -->
             <property name="mail.smtp.host" value="smtpboston2.evergreeninsite.com"/>
            
             <!-- Change to the address mail will be from -->
             <property name="mail.from" value="EvergreenAccessControl@evergreeninvestments.com"/>
            
             <!-- Enable debugging output from the javamail classes -->
             <property name="mail.debug" value="true"/>
             </configuration>
             <depends>jboss:service=Naming</depends>
             </attribute>
             </mbean>
            
            </server>
            
            


            • 3. Re: Need some help with Seam Email
              Bradley Smith Master

              ok - I got it working.

              the problem was here:

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


              I had to change this to:

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


              maybe session-jndi-name should be removed from the mail XSD in favor of component's jndi-name?

              • 4. Re: Need some help with Seam Email
                Gavin King Master

                naw, they have different semantics...

                • 5. Re: Need some help with Seam Email
                  Bradley Smith Master

                  could you explain the differences?

                  Thanks

                  • 6. Re: Need some help with Seam Email
                    Pete Muir Master

                    jndi-name is equivalent to @JndiName (http://docs.jboss.com/seam/1.1.6.GA/reference/en/html/annotations.html#jndiname-annotation) and so would affect the manager component, session-jndi-name is where the javax.mail.Session is located in JNDI - so the reason it's called session-jndi-name is that jndi-name is already taken ;)

                    • 7. Re: Need some help with Seam Email
                      Gavin King Master

                      jndi-name is the name used by Component to "look up" or "instantiate" a session bean component. xxxx-jndi-name is the name used by a component to find some resource it needs to function.


                      It would be nice if our XSD eliminated the jndi-name attribute for components which are not session beans:

                      http://jira.jboss.org/jira/browse/JBSEAM-822

                      • 8. Re: Need some help with Seam Email
                        Bradley Smith Master

                        thanks for both replies - originally my IDE offered up jndi-name as an attribute and I selected it. One other item you might want to fix is the Seam 1.1.6 docs use the following attribute name:

                        16.2.1.1. JNDI lookup in JBoss AS
                        
                        The JBossAS deploy/mail-service.xml configures a JavaMail session binding into JNDI. The default service configuration will need altering for your network. http://wiki.jboss.org/wiki/Wiki.jsp?page=JavaMail describes the service in more detail.
                        
                        <components xmlns="http://jboss.com/products/seam/components"
                         xmlns:core="http://jboss.com/products/seam/core"
                         xmlns:mail="http://jboss.com/products/seam/mail">
                         <mail:mailSession sessionJndiName="java:/Mail" />
                        </components>
                        


                        Thanks again,
                        Brad Smith

                        • 9. Re: Need some help with Seam Email
                          Pete Muir Master

                          Thanks, that's been fixed in CVS :)