I am trying to use spring itegration imap inbound adapter,but i am getting this exception every time i run my application
java.lang.NoSuchMethodException: org.apache.geronimo.javamail.store.imap.IMAPSSLStore. <init>(javax.mail.Session, javax.mail.URLName)
at java.lang.Class.getConstructor0(Class.java:2971)
at java.lang.Class.getConstructor(Class.java:1812)
at javax.mail.Session.getService(Session.java:799)
at javax.mail.Session.getStore(Session.java:586)
at javax.mail.Session.getStore(Session.java:548)
at org.springframework.integration.mail.AbstractMailReceiver.openSession(AbstractMailReceiver.java:207)
at org.springframework.integration.mail.AbstractMailReceiver.openFolder(AbstractMailReceiver.java:226)
at org.springframework.integration.mail.ImapMailReceiver.waitForNewMessages(ImapMailReceiver.java:148)
at org.springframework.integration.mail.ImapIdleChannelAdapter$IdleTask.run(ImapIdleChannelAdapter.java:220)
at org.springframework.integration.mail.ImapIdleChannelAdapter$ReceivingTask.run(ImapIdleChannelAdapter.java:190)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
My spring configuration is this
<int-mail:imap-idle-channel-adapter id="imapAdapter"
store-uri="imaps://username:password1@imap.gmail.com:993/inbox"
java-mail-properties="javaMailProperties"
channel="receiveChannel"
should-delete-messages="false"
should-mark-messages-as-read="false"
auto-startup="true"/>
<util:properties id="javaMailProperties">
<prop key="mail.imap.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
<prop key="mail.imap.socketFactory.fallback">false</prop>
<prop key="mail.store.protocol">imaps</prop>
<prop key="mail.debug">true</prop>
</util:properties>
Anyone any idea??
Most likely you are using an incompatible (probably old) JavaMail version. What version of geronimo are you using?
Spring integration is built/tested with javax.mail
1.5.2 (and the com.sun.mail
implementation).