camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vilito Exquisitus <j...@lorrev.org>
Subject Re: Cannot get Camel to work with Dovecot IMAP
Date Wed, 28 Apr 2010 18:05:02 GMT

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}");
>>   }	
>> }
>> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Cannot-get-Camel-to-work-with-Dovecot-IMAP-tp28381349p28392140.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message