You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by ys...@symcor.com on 2006/01/23 22:58:52 UTC

CORRECTION <- Fw: javamail

Sorry for the confusion.  I should have said "I could NOT find a sample
deployment plan for
javamail" instead.

Thanks,

Young

----- Forwarded by Young Kim/TOR/SYM on 23/01/2006 04:59 PM -----
                                                                           
             yskim@symcor.com                                              
                                                                           
             23/01/2006 04:56                                           To 
             PM                        user@geronimo.apache.org            
                                                                        cc 
                                       user@geronimo.apache.org            
             Please respond to                                     Subject 
             user@geronimo.apa         Re: javamail                        
                  che.org                                                  
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           





Hello, could I have a good deployment plan XML file so that I can deploy
mail in the server scope.  I do not want to put the deployment part in
geronimo-application.xml.  I could find a sample deployment plan for
javamail.

Thanks,

Young




             "Jakob Færch
             (Trifork)"
             <jr...@trifork.com>                                          To
                                       user@geronimo.apache.org
             20/01/2006 12:55                                           cc
             PM
                                                                   Subject
                                       Re: javamail
             Please respond to
             user@geronimo.apa
                  che.org









Alex Andrushchak wrote:
> Ok, i've moved from dead point :-)
>

Wonderful!

> Now i have another problem:
> Cannot send the message with MailerBean:java.lang.Exception: The message
> can not be send : Unable to locate provider for protocol: smtp

The transport for smtp is located in the file
geronimo-1.0\repository\geronimo\jars\geronimo-javamail-transport-1.0.jar.

By some odd mistake, it is not included in the tomcat distribution.
If you are using a jetty distribution, the jar file should be there all
right in GERONIMO_INSTALL_DIR/repository/geronimo/jars.
If you are on a tomcat distribution, I _guess_ you would be fine
downloading the jetty distribution and manually copying the jar file
from the above directory in the jetty distribution to the same directory
  in the tomcat distribution - anyone: feel free to correct me on this!

In order to make the smtp transport available to your application, you
need to add the following dependency to the application's plan:
<dependency>
     <groupId>geronimo</groupId>
     <artifactId>geronimo-javamail-transport</artifactId>
     <version>1.0</version>
</dependency>


> My application configuration is:
>    <gbean name="protocol.smtp"
> class="org.apache.geronimo.mail.SMTPTransportGBean">
>        <attribute name="host">192.168.1.2</attribute>
>        <attribute name="port">25</attribute>
>        <attribute
> name="from">queryphone-geronimo@dekasoft.com.ua</attribute>      </gbean>
>
>    <gbean name="mail/MailSession"
> class="org.apache.geronimo.mail.MailGBean">
>        <attribute name="transportProtocol">smtp</attribute>
>        <attribute name="useDefault">true</attribute>
>        <attribute name="properties">mail.debug=true</attribute>
> <reference name="Protocols">
>            <name>protocol.smtp</name>
>        </reference>
>    </gbean>

It's not (yet) entirely well documented how to set up the necessary
GBeans - to say the least.
It seems in the AdventureBuilder (which is able to send mail using the
smtp transport and javamail), the following GBean is sufficient:

<gbean name="mail/MailSession" class="org.apache.geronimo.mail.MailGBean">
         <attribute name="host">${smtpHost}</attribute>
         <attribute name="properties">
         mail.from=${smtpFrom}
         mail.smtp.port=${smtpPort}</attribute>
</gbean>


Note that compared to you configuration, the smtp host and port is on
the MailGBean, not the SMTPTransportGBean. I guess things will work with
the SMTPTransportGBean configured alongside the MailGBean, but my
experience was that the SMTPTransportGBean was not necessary - anyone:
correct me on this!

Alex, I hope this helps you; please keep the list updated on your progress.

Jakob