Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7648E102E5 for ; Tue, 18 Mar 2014 15:43:54 +0000 (UTC) Received: (qmail 4459 invoked by uid 500); 18 Mar 2014 15:43:53 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 4215 invoked by uid 500); 18 Mar 2014 15:43:52 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 4205 invoked by uid 99); 18 Mar 2014 15:43:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Mar 2014 15:43:51 +0000 X-ASF-Spam-Status: No, hits=3.3 required=5.0 tests=FREEMAIL_REPLY,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of contactreji@gmail.com does not designate 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Mar 2014 15:43:47 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1WPwAo-0001zQ-Gm for users@camel.apache.org; Tue, 18 Mar 2014 08:43:26 -0700 Date: Tue, 18 Mar 2014 08:43:26 -0700 (PDT) From: contactreji To: users@camel.apache.org Message-ID: <1395157406511-5749050.post@n5.nabble.com> In-Reply-To: References: <1395155306302-5749047.post@n5.nabble.com> Subject: Re: Polling Email Component - Runtime Error MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Claus Thanks for that quick help. I have modified my route file as follows and passed the Exchange into a processor class where I process the contents. * * Yet am getting following error. It looks more like issues with extracting body from email. 2014-03-18 21:04:05,883 [ing.Main.main()] INFO SpringCamelContext - Total 1 routes, of which 1 is started. 2014-03-18 21:04:05,886 [ing.Main.main()] INFO SpringCamelContext - Apache Camel 2.10.0.fuse-71-047 (CamelContext: camel-1) started in 0.820 seconds 2014-03-18 21:04:16,421 [/imap.gmail.com] WARN MailConsumer - Caused by: [org.apache.camel.RuntimeCamelException - Failed to extract body due to: null. Exchange: Exchange[MailMessage: messageNumber=[1], from=[Frenchi Elizabeth ], to=[reji.cafe@gmail.com], subject=[test], sentDate=[18 Mar, 2014 8:55:42 PM], receivedDate=[18 Mar, 2014 8:55:43 PM]]. Message: com.sun.mail.imap.IMAPMessage@151c590] org.apache.camel.RuntimeCamelException: Failed to extract body due to: null. Exchange: Exchange[MailMessage: messageNumber=[1], from=[Frenchi Elizabeth ], to=[reji.cafe@gmail.com], subject=[test], sentDate=[18 Mar, 2014 8:55:42 PM], receivedDate=[18 Mar, 2014 8:55:43 PM]]. Message: com.sun.mail.imap.IMAPMessage@151c590 at org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:269) at org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:96) at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41) at org.apache.camel.impl.MessageSupport.copyFrom(MessageSupport.java:135) at org.apache.camel.component.mail.MailMessage.copyFrom(MailMessage.java:130) at org.apache.camel.impl.MessageSupport.copy(MessageSupport.java:124) at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:56) at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:33) at org.apache.camel.impl.DefaultUnitOfWork.(DefaultUnitOfWork.java:91) at org.apache.camel.impl.DefaultUnitOfWork.(DefaultUnitOfWork.java:71) at org.apache.camel.processor.UnitOfWorkProcessor.createUnitOfWork(UnitOfWorkProcessor.java:190) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102) at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.mail.MailConsumer.processExchange(MailConsumer.java:238) at org.apache.camel.component.mail.MailConsumer.processBatch(MailConsumer.java:189) at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:115) at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:142) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at javax.mail.internet.ParameterList.set(ParameterList.java:165) at com.sun.mail.imap.protocol.BODYSTRUCTURE.parseParameters(BODYSTRUCTURE.java:404) at com.sun.mail.imap.protocol.BODYSTRUCTURE.(BODYSTRUCTURE.java:224) at com.sun.mail.imap.protocol.BODYSTRUCTURE.(BODYSTRUCTURE.java:109) at com.sun.mail.imap.protocol.FetchResponse.parse(FetchResponse.java:158) at com.sun.mail.imap.protocol.FetchResponse.(FetchResponse.java:67) at com.sun.mail.imap.protocol.IMAPResponse.readResponse(IMAPResponse.java:136) at com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:270) at com.sun.mail.iap.Protocol.command(Protocol.java:313) at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1529) at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1521) at com.sun.mail.imap.protocol.IMAPProtocol.fetchBodyStructure(IMAPProtocol.java:1221) at com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1307) at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:623) at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:927) at org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:241) ... 31 more -- View this message in context: http://camel.465427.n5.nabble.com/Polling-Email-Component-Runtime-Error-tp5749047p5749050.html Sent from the Camel - Users mailing list archive at Nabble.com.