Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 51809 invoked from network); 26 Nov 2009 11:20:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Nov 2009 11:20:16 -0000 Received: (qmail 48503 invoked by uid 500); 26 Nov 2009 11:20:15 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 48488 invoked by uid 500); 26 Nov 2009 11:20:15 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 48478 invoked by uid 500); 26 Nov 2009 11:20:15 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 48475 invoked by uid 99); 26 Nov 2009 11:20:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2009 11:20:15 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2009 11:20:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CD428234C052 for ; Thu, 26 Nov 2009 03:19:52 -0800 (PST) Message-ID: <1682689074.1259234392838.JavaMail.jira@brutus> Date: Thu, 26 Nov 2009 03:19:52 -0800 (PST) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Assigned: (CAMEL-2231) Exception during mail connection requires folder to be reset In-Reply-To: <434228368.1259234032723.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c [ https://issues.apache.org/activemq/browse/CAMEL-2231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen reassigned CAMEL-2231: ---------------------------------- Assignee: Claus Ibsen > Exception during mail connection requires folder to be reset > ------------------------------------------------------------ > > Key: CAMEL-2231 > URL: https://issues.apache.org/activemq/browse/CAMEL-2231 > Project: Apache Camel > Issue Type: Bug > Components: camel-mail > Affects Versions: 1.6.2, 2.0.0 > Environment: 2.1-SNAPSHOT > Reporter: Christopher Hunt > Assignee: Claus Ibsen > Original Estimate: 2 hours > Remaining Estimate: 2 hours > > I think that this problem may still be around with 2.1-SNAPSHOT: > http://fusesource.com/forums/thread.jspa?threadID=746&tstart=0 > I noticed that I had a pop3 server outage and then subsequently had a similar problem i.e. IllegalStateException, folder not open. > Here's when the outage started. > {code} > 2009-11-26 11:57:55,316 [: MailComponent] WARN ultPollingConsumerPollStrategy - Consumer Consumer[pop3://...] could not poll endpoint: pop3://... caused by: Connect failed > javax.mail.MessagingException: Connect failed; > nested exception is: > java.net.NoRouteToHostException: No route to host > at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:161) > at javax.mail.Service.connect(Service.java:288) > at org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:241) > at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:79) > at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) > at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > Caused by: java.net.NoRouteToHostException: No route to host > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) > at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) > at java.net.Socket.connect(Socket.java:519) > at java.net.Socket.connect(Socket.java:469) > at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233) > at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189) > at com.sun.mail.pop3.Protocol.(Protocol.java:94) > at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:214) > at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:157) > ... 13 more > {code} > This went on for about a minute or so and there was no more in the log file until several hours later - in fact when an email appeared in the INBOX. I know this because my personal email account was copied on the email and so I have the timestamp. > I then get the following message every time I poll the server and have to re-start my application to get over it: > {code} > 2009-11-26 19:19:57,293 [: MailComponent] ERROR MailConsumer - Folder not open > java.lang.IllegalStateException: Folder not open > at javax.mail.Folder.getMessages(Folder.java:938) > at javax.mail.Folder.search(Folder.java:1226) > at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:107) > at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) > at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > {code} > I took a look at MailConsumer.java and note the following code: > {code} > 236 if (!connected) { > 237 if (LOG.isDebugEnabled()) { > 238 LOG.debug("Connecting to MailStore: " + endpoint.getConfiguration().getMailStoreLogInformation()); > 239 } > 240 store = sender.getSession().getStore(config.getProtocol()); > 241 store.connect(config.getHost(), config.getPort(), config.getUsername(), config.getPassword()); > 242 } > {code} > If you're not connected then how is it possible to have a folder? Following this logic my recommendation is to insert the following at line 242: > {code} > 241 store.connect(config.getHost(), config.getPort(), config.getUsername(), config.getPassword()); > folder = null; > 242 } > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.