Hi,

You just put these jars into your classpath
(replace the camel* jar with your version)

aopalliance:aopalliance:jar:1.0:compile
com.sun.xml.bind:jaxb-impl:jar:2.1.12:compile
commons-logging:commons-logging:jar:1.1.1:test
commons-logging:commons-logging-api:jar:1.1:compile
javax.activation:activation:jar:1.1:compile
javax.mail:mail:jar:1.4.3:compile
javax.xml.bind:jaxb-api:jar:2.1:compile
javax.xml.stream:stax-api:jar:1.0-2:compile
log4j:log4j:jar:1.2.14:test
org.apache.camel:camel-core:jar:2.3-SNAPSHOT:compile
org.apache.camel:camel-spring:jar:2.3-SNAPSHOT:compile
org.apache.camel:camel-mail:jar:2.3-SNAPSHOT:compile
org.fusesource.commonman:commons-management:jar:1.0:compile
org.springframework:spring-aop:jar:2.5.6:compile
org.springframework:spring-beans:jar:2.5.6:compile
org.springframework:spring-context:jar:2.5.6:compile
org.springframework:spring-context-support:jar:2.5.6:compile
org.springframework:spring-core:jar:2.5.6:compile
org.springframework:spring-tx:jar:2.5.6:compile

Willem


Vilito Exquisitus wrote:
Hi Willem,

thanks for the reply.  I was using the grails plugin which was using Camel
1.6.0.  However, I decided to create a simple Java SE application using the
latest Camel lib (2.2.0) and the latest mail.jar (1.4.3) from Sun JavaMail. After adding all the jars from the Camel distro (including optionals) and the mail.jar, I now get the following error: Exception in thread "main" java.lang.NoClassDefFoundError:
org/springframework/mail/javamail/JavaMailSender

According the the Spring documentation, two implementations of the
MailSender API are shipped with Spring.

Since I added every jar that was in the Camel distro, I am surprise to see
that error message.  The Camel distro includes some Spring jars.

Here is my simple Java SE example program in a few lines.  NOTE: This
example tries to get Google mail since that had worked in the grails app:
//  -----------------------
public class Main {
    public static void main(String[] args) throws Exception {
      CamelContext camelContext = new DefaultCamelContext();
      camelContext.addRoutes(new RouteBuilder(){
        public void configure(){
from("imaps://imap.gmail.com?username=testuser&password=somepasswd").process(new
Processor(){
             public void process(Exchange exchng) throws Exception {
                System.out.println("Got MESSAGE from GMAIL.");
                System.out.println("->> mesg = " +
exchng.getIn().getBody().toString());
             }
           });
         }
      });

      camelContext.start();
   }
}







willem.jiang wrote:
Hi,

Which version of Camel are you using?
Which version of Mail jar are you using?

There are some bugs with the Geronimo mail jar, so we switch to javax.mail last year, please make sure you are using the javax.mail.jar.

Willem


Vilito Exquisitus wrote:
Hi all,

I am having a problem doing something that seems rather simple, read
email
from an IMAP server (dovecot).   I have dovecot deployed on a Ubuntu
server
and verified the setup using Thunderbird email client. I can send and
receive emails from the test account.  However, when I tried to get the
emails from this account using Camel, it doesn't work.  If I change the
account setting to my gmail account, it works.

So it seems like dovecot is working fine with an email client, and I have
even tested it using telnet to list folders and that works too.  I came
here
after googling abit and trying for a few hours.  I hope I am not missing
something obvious.

Thanks a lot.

.v

the route is:
from("imap://<my-server>?username=testuser" +
        "&password=somepw&deleteProcessedMessages=false" +
        "&processOnlyUnseenMessages=true&consumer.delay=60000")
    .process(new MyProcessor());

The class my processor is in Groovy:
/// ----------------------------------------
package com.esl.ecas.model.service;
import org.apache.camel.Exchange;
import org.apache.camel.Message;

class MyProcessor implements org.apache.camel.Processor{
  public void process(Exchange exchng) throws Exception {
    println("MyProcessor.process(): ${exchng}");
    Message inMesg = exchng.getIn();
    println("->In Message: ${inMesg}");
  }     
}





Reply via email to