Something that worked for me:
I have a Liferay war, 4.3.1-trunk, running inside Geronimo-Tomcat 1.1.1. In
order to get the smtp mailer working, it was necessary to add the following
dependency to geronimo-web.xml:
<dependency>
<groupId>geronimo</groupId>
<artifactId>javamail</artifactId>
<version>1.1.1</version>
<type>car</type>
</dependency>
The following bug report was key to getting things working:
http://issues.apache.org/jira/browse/GERONIMO-2498
based on debug diags I was evaluating that showed:
"Unable to locate provider for protocol: smtp"
when invoking session instance of:
javax.mail.Transport.send(...)
The war declares a gbean in geronimo-web.xml as:
<resource-ref>
<ref-name>mail/MailSession</ref-name>
<resource-link>LiferayMailSession</resource-link>
</resource-ref>
<gbean name="LiferayMailSession"
class="org.apache.geronimo.mail.MailGBean">
<attribute name="transportProtocol">smtp</attribute>
<attribute name="host">my-mail-server</attribute>
</gbean>
with the following dependencies:
<dependency>
<groupId>geronimo</groupId>
<artifactId>geronimo-mail</artifactId>
<type>jar</type>
<import>classes</import>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-javamail_1.3.1_spec</artifactId>
<type>jar</type>
<import>classes</import>
</dependency>
and referenced in web.xml as:
<resource-ref>
<res-ref-name>mail/MailSession</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
- bvj
Christopher M. Cardona wrote:
> I would like to do the same change for trunk. Anybody got
> issues/concerns/objections to this?
There's an open JIRA for doing this that's marked as a "wish item".
http://issues.apache.org/jira/browse/GERONIMO-2498
I'd say go for it.
Rick
--
View this message in context:
http://www.nabble.com/Fixing-javamail-%28again%29-tf2431708s134.html#a11734805
Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.