camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-7739) camel-mail poller onCompletion Folder is not Open
Date Sun, 15 Feb 2015 11:35:12 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-7739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen resolved CAMEL-7739.
--------------------------------
    Resolution: Fixed

> camel-mail poller onCompletion Folder is not Open
> -------------------------------------------------
>
>                 Key: CAMEL-7739
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7739
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, camel-mail
>    Affects Versions: 2.13.0
>            Reporter: Laabidi Raissi
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: bug, onCompletion, pop3
>             Fix For: 2.13.4, 2.14.2, 2.15.0
>
>
> I think I found a bug in Camel OncompletionProcessor code when used with a Mail poller
route and onCompletion.
> The error occurs when the Log level is set to DEBUG or TRACE. In that case the logger
tries to call the toString() method of the DefaultExchange class which calls org.apache.camel.component.mail.MailMessage.toString().
> At that stage, the POP3Folder is already closed.
> A very obvious (but not elegant) solution, would be to add a try-catch block to the log
instruction. 
> Otherwise, I think a good solution is to change the DefaultExchange#toString method.
> Here is the exception that occured:
> java.lang.IllegalStateException: Folder is not Open
> 	at com.sun.mail.pop3.POP3Folder.checkOpen(POP3Folder.java:551)
> 	at com.sun.mail.pop3.POP3Folder.getProtocol(POP3Folder.java:581)
> 	at com.sun.mail.pop3.POP3Message.loadHeaders(POP3Message.java:606)
> 	at com.sun.mail.pop3.POP3Message.getHeader(POP3Message.java:383)
> 	at javax.mail.internet.MimeMessage.getAddressHeader(MimeMessage.java:701)
> 	at javax.mail.internet.MimeMessage.getFrom(MimeMessage.java:362)
> 	at org.apache.camel.component.mail.MailUtils.dumpMessage(MailUtils.java:106)
> 	at org.apache.camel.component.mail.MailMessage.toString(MailMessage.java:49)
> 	at java.lang.String.valueOf(String.java:2854)
> 	at java.lang.StringBuilder.append(StringBuilder.java:128)
> 	at org.apache.camel.impl.DefaultExchange.toString(DefaultExchange.java:81)
> 	at org.slf4j.helpers.MessageFormatter.safeObjectAppend(MessageFormatter.java:304)
> 	at org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:276)
> 	at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:230)
> 	at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:115)
> 	at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:439)
> 	at ch.qos.logback.classic.Logger.filterAndLog_1(Logger.java:413)
> 	at ch.qos.logback.classic.Logger.debug(Logger.java:506)
> 	at org.apache.camel.processor.OnCompletionProcessor$OnCompletionSynchronization$1.call(OnCompletionProcessor.java:178)
> 	at org.apache.camel.processor.OnCompletionProcessor$OnCompletionSynchronization$1.call(OnCompletionProcessor.java:176)
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:722)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message