1 Reply Latest reply on Jul 12, 2009 7:46 PM by Robert Morse

    Seam-mail example connection refused

    Robert Morse Apprentice

      Hello,
      I'm trying to get the seam-mail example to work under seam-2.2.0.CR1 and JBoss 5.1.0.GA.  When I run the example, I get a Connection Refused to localhost 2525.  I know this is a simple configuration issue, but I'm just not seeing it.  It's my understanding that the example uses Meldware as the SMTP server on port 2525, but that doesn't seem to be the case.  I've used seam mail connecting to other SMTP servers without a problem, but I'm missing why they example doesn't work.  My mail-service.xml file looks as follows.




      <?xml version="1.0" encoding="UTF-8"?>
      <!-- $Id: mail-service.xml 62350 2007-04-15 16:50:12Z dimitris@jboss.org $ -->
      <server>
      
        <!-- ==================================================================== -->
        <!-- Mail Connection Factory                                              -->
        <!-- ==================================================================== -->
      
        <mbean code="org.jboss.mail.MailService"
               name="jboss:service=Mail">
          <attribute name="JNDIName">java:/Mail</attribute>
          <attribute name="User">test</attribute>
          <attribute name="Password">test</attribute>
          <attribute name="Configuration">
            <!-- A test configuration -->
            <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="localhost"/>
      
              <!-- Change to the SMTP gateway server -->
              <property name="mail.smtp.host" value="localhost"/>
              
              <!-- The mail server port -->
              <property name="mail.smtp.port" value="2525"/>
              
              <!-- Change to the address mail will be from  -->
              <property name="mail.from" value="postmaster@mdesignz.com"/>
      
              <!-- Enable debugging output from the javamail classes -->
              <property name="mail.debug" value="true"/>
            </configuration>
          </attribute>
          <depends>jboss:service=Naming</depends>
        </mbean>
      
      </server>




        • 1. Re: Seam-mail example connection refused
          Robert Morse Apprentice

          A few things have turned up in my attempt to get this running.  The most obvious is that Meldware isn't starting up -- hence the connection error.  Turns out:


          The persistence.xml in mailbeans.jar gives JBoss 5.1.0 some problems.  It needs to look like this:



          <?xml version="1.0" encoding="UTF-8" ?> 
          <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
            <persistence-unit name="mail">
            <jta-data-source>java:/MeldwareDS</jta-data-source>
            <properties>
              <property name="jboss.entity.manager.jndi.name" value="java:/EntityManagers/mail"/>
              <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
              <property name="hibernate.hbm2ddl.auto" value="update"/>
              <!--
              <property name="hibernate.show_sql"
                        value="true"/>
              -->
            </properties>
            </persistence-unit>
          </persistence>
          


          and the meldware jars need to be in JBOSS_HOME/common/lib
          When I tried to use the Buni distribution, there were complaints about its mailjmx.sar, so I replaced it with the version found in Seam 2.2.0.CR1 distribution.    Now the server is coming up, and I can connect to it.  Doesn't look like Meldware is actively being supported.  Wonder if an official JBoss 5.x version will be produced.  Anyway, looks like it will work, but the road getting there wasn't very pleasant.