org.springframework.messaging.MessagingException: failure occurred while polling for mail

Spring JIRA | Tony | 2 years ago
  1. 0

    After upgraded from 4.0.3 to 4.0.4. I noticed that after for quite sometimes running the email poller, i received exceptions. any help would be appreciated. Current setup is: {code:xml} <Resource name="mail/Session" auth="Container" type="javax.mail.Session" username="xxxx" password="xxxxx" mail.debug="false" mail.user="xxxxx" mail.password="xxxx" mail.imap.host="xxxxx" mail.imap.fetchsize ="1048576" mail.imap.connectiontimeout="60000" mail.imap.timeout="60000" mail.imap.writetimeout="60000" /> {code} spring bean: {code:xml} <int-mail:inbound-channel-adapter id="imapAdapter" store-uri="${paip.mail.store-uri}" channel="receiveChannel" should-delete-messages="false" should-mark-messages-as-read="true" protocol="imap" session="paipMailSession" auto-startup="true"> <int:poller max-messages-per-poll="10" fixed-rate="${paip.mail.poll.rate}" time-unit="SECONDS"> <int:transactional transaction-manager="txManager" synchronization-factory="syncFactory" /> </int:poller> </int-mail:inbound-channel-adapter> {code} exceptions are: {noformat} 2014-10-21 17:28:58,116 ERROR : LoggingHandler - org.springframework.messaging.MessagingException: failure occurred while polling for mail at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:117) at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:124) at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:192) at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:55) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:149) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146) at sun.reflect.GeneratedMethodAccessor262.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:266) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy52.call(Unknown Source) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:298) at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50) at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:292) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: javax.mail.StoreClosedException: * BYE JavaMail Exception: java.net.SocketException: Socket closed at com.sun.mail.imap.IMAPFolder.throwClosedException(IMAPFolder.java:2751) at com.sun.mail.imap.IMAPFolder.doCommand(IMAPFolder.java:2871) at com.sun.mail.imap.IMAPFolder.exists(IMAPFolder.java:514) at org.springframework.integration.mail.AbstractMailReceiver.openFolder(AbstractMailReceiver.java:229) at org.springframework.integration.mail.AbstractMailReceiver.receive(AbstractMailReceiver.java:249) at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:103) ... 31 more org.springframework.messaging.MessagingException: failure occurred while polling for mail at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:117) at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:124) at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:192) at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:55) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:149) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146) at sun.reflect.GeneratedMethodAccessor262.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:266) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy52.call(Unknown Source) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:298) at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50) at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:292) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: javax.mail.StoreClosedException: * BYE JavaMail Exception: java.net.SocketException: Socket closed at com.sun.mail.imap.IMAPFolder.throwClosedException(IMAPFolder.java:2751) at com.sun.mail.imap.IMAPFolder.doCommand(IMAPFolder.java:2871) at com.sun.mail.imap.IMAPFolder.exists(IMAPFolder.java:514) at org.springframework.integration.mail.AbstractMailReceiver.openFolder(AbstractMailReceiver.java:229) at org.springframework.integration.mail.AbstractMailReceiver.receive(AbstractMailReceiver.java:249) at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:103) {noformat}

    Spring JIRA | 2 years ago | Tony
    org.springframework.messaging.MessagingException: failure occurred while polling for mail
  2. 0

    [INT-3536] After Long running email polling, socket closed exception thrown - Spring JIRA

    spring.io | 7 months ago
    org.springframework.messaging.MessagingException: failure occurred while polling for mail
  3. 0

    After upgraded from 4.0.3 to 4.0.4. I noticed that after for quite sometimes running the email poller, i received exceptions. any help would be appreciated. Current setup is: {code:xml} <Resource name="mail/Session" auth="Container" type="javax.mail.Session" username="xxxx" password="xxxxx" mail.debug="false" mail.user="xxxxx" mail.password="xxxx" mail.imap.host="xxxxx" mail.imap.fetchsize ="1048576" mail.imap.connectiontimeout="60000" mail.imap.timeout="60000" mail.imap.writetimeout="60000" /> {code} spring bean: {code:xml} <int-mail:inbound-channel-adapter id="imapAdapter" store-uri="${paip.mail.store-uri}" channel="receiveChannel" should-delete-messages="false" should-mark-messages-as-read="true" protocol="imap" session="paipMailSession" auto-startup="true"> <int:poller max-messages-per-poll="10" fixed-rate="${paip.mail.poll.rate}" time-unit="SECONDS"> <int:transactional transaction-manager="txManager" synchronization-factory="syncFactory" /> </int:poller> </int-mail:inbound-channel-adapter> {code} exceptions are: {noformat} 2014-10-21 17:28:58,116 ERROR : LoggingHandler - org.springframework.messaging.MessagingException: failure occurred while polling for mail at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:117) at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:124) at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:192) at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:55) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:149) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146) at sun.reflect.GeneratedMethodAccessor262.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:266) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy52.call(Unknown Source) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:298) at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50) at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:292) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: javax.mail.StoreClosedException: * BYE JavaMail Exception: java.net.SocketException: Socket closed at com.sun.mail.imap.IMAPFolder.throwClosedException(IMAPFolder.java:2751) at com.sun.mail.imap.IMAPFolder.doCommand(IMAPFolder.java:2871) at com.sun.mail.imap.IMAPFolder.exists(IMAPFolder.java:514) at org.springframework.integration.mail.AbstractMailReceiver.openFolder(AbstractMailReceiver.java:229) at org.springframework.integration.mail.AbstractMailReceiver.receive(AbstractMailReceiver.java:249) at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:103) ... 31 more org.springframework.messaging.MessagingException: failure occurred while polling for mail at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:117) at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:124) at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:192) at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:55) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:149) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146) at sun.reflect.GeneratedMethodAccessor262.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:266) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy52.call(Unknown Source) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:298) at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50) at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:292) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: javax.mail.StoreClosedException: * BYE JavaMail Exception: java.net.SocketException: Socket closed at com.sun.mail.imap.IMAPFolder.throwClosedException(IMAPFolder.java:2751) at com.sun.mail.imap.IMAPFolder.doCommand(IMAPFolder.java:2871) at com.sun.mail.imap.IMAPFolder.exists(IMAPFolder.java:514) at org.springframework.integration.mail.AbstractMailReceiver.openFolder(AbstractMailReceiver.java:229) at org.springframework.integration.mail.AbstractMailReceiver.receive(AbstractMailReceiver.java:249) at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:103) {noformat}

    Spring JIRA | 2 years ago | Tony
    org.springframework.messaging.MessagingException: failure occurred while polling for mail
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JavaMail - why do I sporadically get a StoreClosedException on a folder operation?

    Stack Overflow | 6 years ago | slau
    javax.mail.StoreClosedException: failed to create new store connection
  6. 0

    Javamail: Multiple Threads Opening a Folder in Read Write Mode is Blocked

    Stack Overflow | 2 years ago | BhaskarG
    javax.mail.StoreClosedException: failed to create new store connection

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.mail.StoreClosedException

      * BYE JavaMail Exception: java.net.SocketException: Socket closed

      at com.sun.mail.imap.IMAPFolder.throwClosedException()
    2. JavaMail API (compat)
      IMAPFolder.exists
      1. com.sun.mail.imap.IMAPFolder.throwClosedException(IMAPFolder.java:2751)
      2. com.sun.mail.imap.IMAPFolder.doCommand(IMAPFolder.java:2871)
      3. com.sun.mail.imap.IMAPFolder.exists(IMAPFolder.java:514)
      3 frames
    3. org.springframework.integration
      MailReceivingMessageSource.receive
      1. org.springframework.integration.mail.AbstractMailReceiver.openFolder(AbstractMailReceiver.java:229)
      2. org.springframework.integration.mail.AbstractMailReceiver.receive(AbstractMailReceiver.java:249)
      3. org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:103)
      3 frames