Thanks Rick for your quick response on my question.

Unfortunatly I can not use the syntax you suggest (below) as Im working with a qeronimo-quartz plan

http://gplugins.sourceforge.net/schemas/geronimo-quartz-0.2.xsd

Basicly Im trying to figger out just how to translate what you points me to in the context of this deploiment plan.
For instance dose the dependency injection of
           <dependency>
              <groupId>geronimo</groupId>
              <artifactId>javamail</artifactId>
              <version>1.1.1</version>
           </dependency>
correspond to the module line below ? I tryed it out but still gets the same error so i guess it dossent.

Cheers
  Peter

Rick McGuire skrev:
Peter Petersson wrote:
Hi all!

I quite new to Geronimo (using 1.1.1) and have some problems geting mail to work from a geronimo-quartz job. As I understand it I need to set up a gbean or do some other configuration for javamail to work (?).
Yes, your application needs to have a dependency on the javamail config to ensure you're getting all of the correct jar files on your classpath. The protocol problem you cite below is a symptom of not having that. Adding the following to your deployment plan should be sufficient:

   <module name="org.apache.geronimo.configs/javamail/1.1.1/car"/>

That should be sufficient to get the classes on your classpath and allow you do drive everything from your code. Additionally, you can do some basic session configuration in the plan (as opposed to keeping the configuration in your code) by using:

   <module name="org.apache.geronimo.configs/javamail/1.1.1/car">
       <gbean name="SMTPTransport">
           <attribute name="host">smtp.myisp.com</attribute>
           <attribute name="port">25</attribute>
       </gbean>
   </module>

Then in your application, create the mail Session instance using

InitialContext ic = new InitialContext(); Session mailSession = (Session) ic.lookup("java:comp/env/mail/MailSession");

When you request the transport instance from this session, this will pick up the SMTP configuration from the plan.

Rick


The example i have folowed for the Quartz Scheduler Plugin over at http://gplugins.sourceforge.net/ have a nice setup including mailing (in the "Deployable Jobs Example" section) but it dose not go into details on howto set up mailing (its not the scope of the example).

What do I need to do to get it to work? as it is now i get this exception

MessagingException Unable to locate provider for protocol: smtp

Anny good pointer out there to get mailing working in Geronimo ?

Cheers
 Peter


Reply via email to