[jira] Commented: (OFBIZ-156) JavaMailContainer.checkMessages doesn't handle exceptions well

Posted by Nicolas Malin (Jira) on
URL: http://ofbiz.116.s1.nabble.com/jira-Created-OFBIZ-156-JavaMailContainer-checkMessages-doesn-t-handle-exceptions-well-tp170622p170623.html

    [ http://issues.apache.org/jira/browse/OFBIZ-156?page=comments#action_12427820 ]
           
Scott Gray commented on OFBIZ-156:
----------------------------------

I need the finally block to close the connection to the mail store, if an exception occurs while working with the mail folders there is no way to close the connection except using finally.  

The only way i can test it is to wait for an exception to occur, this usually happens while i'm accessing the mail store through a web client at the same time ofbiz is trying to access it, so I'll just have to wait for them to clash again.

> JavaMailContainer.checkMessages doesn't handle exceptions well
> --------------------------------------------------------------
>
>                 Key: OFBIZ-156
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-156
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Scott Gray
>            Priority: Minor
>         Attachments: JMailException.txt
>
>
> If an exception is thrown during checkMessages in the JavaMailContainer, the store is not closed which prevents subsequent attempts to connect and ultimately seems to lockup the poller.  The attached patch should be an improvement, but I'm not much of a programmer so it would be great if someone could look it over.
> Thanks
> Scott

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira