geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakob Færch (Trifork)" <>
Subject Re: javamail
Date Fri, 20 Jan 2006 17:55:45 GMT

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


> 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 

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:

> My application configuration is:
>    <gbean name="protocol.smtp" 
> class="org.apache.geronimo.mail.SMTPTransportGBean">
>        <attribute name="host"></attribute>
>        <attribute name="port">25</attribute>
>        <attribute 
> name="from"></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">

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.


View raw message