[mule-user] Email service, Cannot monitor folder: INBOX as folder is closed

5 views
Skip to first unread message

Shailendra84

unread,
Dec 31, 2009, 1:10:17 AM12/31/09
to us...@mule.codehaus.org

Hi All,
I have a very simple message flow here. I am monitoring the INBOX folder
using the pop3 connector. When a new email arrives it should invoke the flow
and do some business with the new mail and pass something to the ActiveMQ
queue. My configuration is as follows:
<service name="MailService">
<description>
</description>
<inbound>
<inbound-endpoint ref="email"/>
</inbound>
<component
class="com.viithiisys.syndication.MimeToObjectComponent"/>
<outbound>
<pass-through-router>
<outbound-endpoint ref="SynSales"/>
</pass-through-router>
</outbound>
</service>

This flow is working fine, but sometimes an exception occurs saying "Cannot
monitor folder: INBOX as folder is closed", After this exception it doesn;t
monitor the inbox folder. Full trace is as follows:
INFO 2009-12-31 11:20:20,242 [connector.pop3s.0.receiver.7]
org.mule.api.security.provider.AutoDiscoverySecurityProviderFactory: Using
org.mule.api.security.provider.SunSecurityProviderInfo
INFO 2009-12-31 11:20:20,244 [connector.pop3s.0.receiver.7]
org.mule.api.security.tls.TlsPropertiesMapper: Defaulting mule.email.pop3s
trust store to client Key Store
ERROR 2009-12-31 11:20:20,274 [connector.pop3s.0.receiver.7]
org.mule.DefaultExceptionStrategy: Caught exception in Exception Strategy:
Cannot monitor folder: INBOX as folder is closed
javax.mail.MessagingException: Cannot monitor folder: INBOX as folder is
closed
at
org.mule.transport.email.RetrieveMessageReceiver.poll(RetrieveMessageReceiver.java:306)
at
org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:47)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Thread.java:619)
INFO 2009-12-31 11:20:20,275 [connector.pop3s.0.receiver.7]
org.mule.DefaultExceptionStrategy: There is no current event available,
routing Null message with the exception
ERROR 2009-12-31 11:20:20,277 [connector.pop3s.0.receiver.7]
org.mule.transport.email.RetrieveMessageReceiver: Failed to close pop3
inbox: Folder is not Open
INFO 2009-12-31 11:21:20,243 [connector.pop3s.0.receiver.8]
org.mule.api.security.provider.AutoDiscoverySecurityProviderFactory: Using
org.mule.api.security.provider.SunSecurityProviderInfo
INFO 2009-12-31 11:21:20,245 [connector.pop3s.0.receiver.8]
org.mule.api.security.tls.TlsPropertiesMapper: Defaulting mule.email.pop3s
trust store to client Key Store

What can be the cause of this exception and how to avoid it? Any pointers
please..

regards,
Shailendra
--
View this message in context: http://old.nabble.com/Email-service%2C-Cannot-monitor-folder%3A-INBOX-as-folder-is-closed-tp26975809p26975809.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Yuji YAMANO

unread,
Jan 5, 2010, 8:16:24 PM1/5/10
to us...@mule.codehaus.org, khichi.s...@gmail.com
On Wed, 30 Dec 2009 22:10:17 -0800 (PST), Shailendra84 <khichi.s...@gmail.com> wrote:

> ERROR 2009-12-31 11:20:20,274 [connector.pop3s.0.receiver.7]
> org.mule.DefaultExceptionStrategy: Caught exception in Exception Strategy:
> Cannot monitor folder: INBOX as folder is closed
> javax.mail.MessagingException: Cannot monitor folder: INBOX as folder is
> closed
> at
> org.mule.transport.email.RetrieveMessageReceiver.poll(RetrieveMessageReceiver.java:306)

Could you try enabling debug messages?

I glanced RetrieveMessageReceiver.java. I guess it failed to reopen
the folder for some reason.

public synchronized void poll()
{
try
{
try
{
if (!folder.isOpen())
{
folder.open(Folder.READ_WRITE);
}
}
catch (Exception e)
{
if (logger.isDebugEnabled())
{
logger.debug("ignoring exception: " + e.getMessage());
}
}

int count = folder.getMessageCount();
if (count > 0)
{
Message[] messages = folder.getMessages();
MessageCountEvent event = new MessageCountEvent(folder, MessageCountEvent.ADDED, true,
messages);
messagesAdded(event);
}
else if (count == -1)
{
throw new MessagingException("Cannot monitor folder: " + folder.getFullName()
+ " as folder is closed");
}
}


--
Yuji Yamano
OGIS International, Inc.

Reply all
Reply to author
Forward
0 new messages