2014-11-09 60 views
0

我試圖用簧itegration IMAP站適配器,但我每一次我跑我的應用程序Spring集成IMAP適配器例外

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) 

我的春天配置是這個

<int-mail:imap-idle-channel-adapter id="imapAdapter" 
     store-uri="imaps://username:[email protected]: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> 

時間得到這個例外任何想法?

回答

1

很有可能您使用的是不兼容的(可能是舊的)JavaMail版本。你使用什麼版本的geronimo?

彈簧集成是使用javax.mail 1.5.2(和com。sun.mail實現)構建/測試的。

+0

您是對的。我從我的pom中刪除了geronimo依賴項。現在它工作了。謝謝。 – user3004656 2014-11-10 11:04:39

+0

我看到你是Stack Overflow的新手 - 習慣上將答案標記爲「接受」以幫助其他人搜索類似的問題/答案。 – 2014-11-10 13:56:47

相關問題