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

    Null pointer Exception , Camel Mail

    mat dav Newbie

      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