2 Replies Latest reply on Nov 24, 2009 9:31 AM by mdav

    Null pointer Exception , Camel Mail

    mdav

      Hi,

       

      I am trying to connect to linux mail server using the following :

      camel.impl.ScheduledPollConsumer   68 | An exception occured while polling: Endpoint[imap://127.0.0.1:8143?username=mdav&password=pass&fetchSize=1&consumer.delay=5000]: null

       

      It throws the same exception even with direct connected as show below.

       

      store = sender.getSession().getInstance(new Properties()).getStore("imap");

               store.connect("127.0.0.1", 8143, "mdav", "pass");

       

      Both are running as a osgi bundle. Our requirement is to read email using an bundle and then process it / process attatchments. 

       

       

      The localhost and the port are tunnelled to match the server and 143 port.  I get the following expeption .  Any poninters to how to solve this. Is tunnelling causing the problem ?.Please help.

       

      java.lang.NullPointerException

           at org.apache.geronimo.javamail.store.imap.connection.IMAPTaggedResponse.isBAD(IMAPTaggedResponse.java:86)

           at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.receiveResponse(IMAPConnection.java:405)

           at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.sendCommand(IMAPConnection.java:324)

           at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.processLogin(IMAPConnection.java:593)

           at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.processPlainAuthentication(IMAPConnection.java:532)

           at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.login(IMAPConnection.java:483)

           at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.protocolConnect(IMAPConnection.java:176)

           at org.apache.geronimo.javamail.store.imap.connection.IMAPConnectionPool.createPoolConnection(IMAPConnectionPool.java:211)

           at org.apache.geronimo.javamail.store.imap.connection.IMAPConnectionPool.protocolConnect(IMAPConnectionPool.java:177)

           at org.apache.geronimo.javamail.store.imap.IMAPStore.protocolConnect(IMAPStore.java:156)

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

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

           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$1

       

      Thanks

      Mat

        • 1. Re: Null pointer Exception , Camel Mail
          njiang

          Which version of Fuse ESB are you using?

          We switched to use JavaMail few month ago, as the former mail implementation has some bugs.

          • 2. Re: Null pointer Exception , Camel Mail
            mdav

            Hi,

            Iam using , fuse-esb-4.1.0.2 and camel ---fuse-mediation-router-1.6.1.2. In fact I could solve the issue with uninstalling geronimo-javamail-1.4 and installing the spring source jar

             

            com.springsource.javax.mail-1.4.1.jar

             

            Anyway, I would like to know the fix and the correct version to use, (incase ther would be any other issues as I go ahead.)

             

             

            Appreciate your reply.