6 Replies Latest reply on Mar 30, 2009 10:09 AM by Claus Ibsen

    No connection to email till server restart after POP3 exception

    Andreas Braumann Newbie

      Hello all,

       

      we have a problem with our FUSE MQ and I hope someone could help.

       

      Our MQ works fine after his startup. We have a route in the camelcontext to pull emailmessages from a pop3 uri to a local queue. Mails come every minute and it seems all is ok.

       

      Sometimes the MQ throws a warning that the emailserver is unavailable (maybe maintance, timeout or whatever) and after this warning occurs the mq can't connect to the mailserver anymore. Everytime on the next scheduled poll we get a warning Folder not open, but the emailserver is available at this time. This issue occurs till we restart the server.

       

      How we can avoid this restart?

       

      Thanks for help

       

      airber

        • 1. Re: No connection to email till server restart after POP3 exception
          Claus Ibsen Master

          Hi

           

          Can you post some more details:

          - which version of MQ are you using

          - which version of Fuse MR are you using

          - what platform do you run

          - do you know which email server it is?

          - and what is the error you get in the log (with stacktrace if possible)

          - can you turn DEBUG logging on at: org.apache.camel.component.mail

             it will log when it connects/reconnect and much more

           

          From the code point of view its strange as Camel does a pre poll check if the connection is connected on every poll. Would assume the Mail API would return false to isConnected so Camel could do a re-connect before polling.

          • 2. Re: No connection to email till server restart after POP3 exception
            Andreas Braumann Newbie

            Here are some more details:

             

            Fuse Message Broker Version 5.2.0.1

            Fuse Mediation Router Version 1.5.3.0

            JRE 1.6.0_11

            OS: RHEL AS4  Kernel 2.6.9-42.0.3

             

            The emailserver should be a Microsoft Exchange 2007 Server.

             

            Here are the error log I have this time:

             

            2009-03-25 09:04:07,243 mponent@1ff8de3 WARN  ScheduledPollConsumer          - An exception occured while polling: Endpoint pop3://test@192.168.0.16?password=testpw&deleteProcessedMessages=true&consumer.delay=60000 : Server Unavailable. 21

            javax.mail.AuthenticationFailedException: Server Unavailable. 21

                    at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:159)

                    at javax.mail.Service.connect(Service.java:310)

                    at org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:126)

                    at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:72)

                    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)

                    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)

             

             

            2009-03-25 09:05:07,351  mponent@1ff8de3  WARN  ScheduledPollConsumer          - An exception occured while polling: Endpoint pop3://test@192.168.0.16?password=testpw&deleteProcessedMessages=true&consumer.delay=60000 : 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:100)

                    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)

                    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)

             

             

            2009-03-25 09:06:07,256 mponent@1ff8de3 WARN  ScheduledPollConsumer          - An exception occured while polling: Endpoint pop3://test@192.168.0.16?password=testpw&deleteProcessedMessages=true&consumer.delay=60000 : 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:100)

                    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)

                    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)

             

             

            thx

            airber

             

            Edited by: airber on Mar 30, 2009 9:09 AM

             

            Edited by: airber on Mar 30, 2009 9:11 AM

            • 3. Re: No connection to email till server restart after POP3 exception
              Claus Ibsen Master

              Hi

               

              Thanks a lot for the detailed report and with the stack traces that can lead us to a fix for your problem.

               

              I have created a ticket in our issue tracker to track this problem

              http://fusesource.com/issues/browse/MR-157

              • 4. Re: No connection to email till server restart after POP3 exception
                Claus Ibsen Master

                Hi

                 

                I have committed a fix in FUSE MR. It should be in the next release scheduled in April.

                 

                There should be SNAPSHOTS builds in the fuse maven repo

                http://repo.fusesource.com/

                 

                Its this one:

                http://repo.fusesource.com/maven2-snapshot/

                 

                And you can use this version:

                1.x-fuse-SNAPSHOT

                 

                There should be a new build later today/tomorrow with a fix in the camel-mail.jar.

                • 5. Re: No connection to email till server restart after POP3 exception
                  Andreas Braumann Newbie

                  Thx alot for your help

                   

                  greetings

                  airber

                   

                  Edited by: airber on Mar 30, 2009 1:38 PM

                  • 6. Re: No connection to email till server restart after POP3 exception
                    Claus Ibsen Master

                    Would be great if you could test it. However as I dont have a live system with a Exchange 2007 mail server I have not tested the patch with a live system.

                     

                    There could potentially still be an issue. If so then please report back and I can see what we can do.