Announcement Announcement Module
Collapse
No announcement yet.
No Content error with mail:imap-idle-channel-adapter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No Content error with mail:imap-idle-channel-adapter

    Hi

    I'm struggling with an Exception thrown whilst trying to fetch mail from gmail using mail:imap-idle-channel-adapter.

    I have 'should-delete-messages' set to true (if I set this to false I don't get the error) and I think that maybe the message is getting deleted before it is fetched.

    I am working with SI 2.0.0.M6 but have also tried this with 1.0.04.RELEASE and have the same problem.

    My config is:
    Code:
    <beans:bean id="inboundJavaMailProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
    	
    	<beans:property name="properties">
    			<beans:props>
    				<beans:prop key="mail.debug">true</beans:prop>
    		</beans:property>
    </beans:bean>	
    	
    
    	<mail:imap-idle-channel-adapter
    		should-delete-messages="true" java-mail-properties="inboundJavaMailProperties" channel="mailIn"
    		store-uri="imaps://user%40domain.com:[email protected]:993/INBOX" />
    Here is some debug output from java mail and the exception stack trace. Hopefully someone can help.

    Code:
    2010-08-20 10:03:55,965 [SimpleAsyncTaskExecutor-1] DEBUG org.springframework.integration.mail.ImapIdleChannelAdapter - waiting for mail
    DEBUG: JavaMail version 1.4.3
    DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
    DEBUG: Tables of loaded providers
    DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
    DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
    DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
    DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc]
    DEBUG: mail.imap.fetchsize: 16384
    DEBUG: mail.imap.statuscachetimeout: 1000
    DEBUG: mail.imap.appendbuffersize: -1
    DEBUG: mail.imap.minidletime: 10
    
    2010-08-20 10:03:56,144 [SimpleAsyncTaskExecutor-1] DEBUG org.springframework.integration.mail.ImapMailReceiver - connecting to store [imaps://[email protected]:*****@imap.gmail.com:993/INBOX]
    DEBUG: trying to connect to host "imap.gmail.com", port 993, isSSL true
    
    * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA XLIST CHILDREN XYZZY SASL-IR AUTH=XOAUTH
    A0 OK Thats all she wrote! x18if3896700weq.87
    IMAP DEBUG: AUTH: XOAUTH
    DEBUG: protocolConnect login, host=imap.gmail.com, user=[email protected], password=<non-null>
    A1 LOGIN [email protected] password
    
    * CAPABILITY IMAP4rev1 UNSELECT LITERAL+ IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE
    A1 OK [email protected] authenticated (Success)
    A2 CAPABILITY
    * CAPABILITY IMAP4rev1 UNSELECT LITERAL+ IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE
    A2 OK Success
    A3 LIST "" INBOX
    2010-08-20 10:03:59.032:/hostname-client-portal:INFO:  org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok)
    [INFO] Started Jetty Server
    2010-08-20 10:04:00.183::INFO:  Started [email protected]:8080
    * LIST (\HasNoChildren) "/" "INBOX"
    A3 OK Success
    2010-08-20 10:04:00,164 [SimpleAsyncTaskExecutor-1] DEBUG org.springframework.integration.mail.ImapMailReceiver - opening folder [imaps://[email protected]:*****@imap.gmail.com:993/INBOX]
    DEBUG: connection available -- size: 1
    A4 SELECT INBOX
    * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
    * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)]
    * OK [UIDVALIDITY 640851542]
    * 3 EXISTS
    * 0 RECENT
    * OK [UIDNEXT 21]
    A4 OK [READ-WRITE] INBOX selected. (Success)
    A5 IDLE
    + idling
    * 4 EXISTS
    DONE
    A5 OK IDLE terminated (Success)
    A6 FETCH 4 (BODYSTRUCTURE)
    * 4 FETCH (BODYSTRUCTURE ("TEXT" "PLAIN" ("CHARSET" "ISO-8859-1") NIL NIL "7BIT" 4 1 NIL NIL NIL))
    A6 OK Success
    * OK Gimap ready for requests from *.*.*.* n2if3902961wej.11
    A0 CAPABILITY
    * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA XLIST CHILDREN XYZZY SASL-IR AUTH=XOAUTH
    A0 OK Thats all she wrote! n2if3902961wej.11
    IMAP DEBUG: AUTH: XOAUTH
    A1 LOGIN [email protected] password
    * CAPABILITY IMAP4rev1 UNSELECT LITERAL+ IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE
    A1 OK [email protected] authenticated (Success)
    A2 CAPABILITY
    * CAPABILITY IMAP4rev1 UNSELECT LITERAL+ IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE
    A2 OK Success
    IMAP DEBUG: IMAPProtocol noop
    A3 NOOP
    A3 OK Success
    A7 LIST "" INBOX
    * LIST (\HasNoChildren) "/" "INBOX"
    A7 OK Success
    
    
    A9 OK Success
    A10 STORE 1 +FLAGS (\Deleted)
    * 1 FETCH (FLAGS (\Deleted))
    A10 OK Success
    A11 STORE 2 +FLAGS (\Deleted)
    * 2 FETCH (FLAGS (\Deleted))
    A11 OK Success
    A12 STORE 3 +FLAGS (\Deleted)
    * 3 FETCH (FLAGS (\Seen \Deleted))
    A12 OK Success
    A13 STORE 4 +FLAGS (\Deleted)
    * 4 FETCH (FLAGS (\Deleted))
    A13 OK Success
    A14 FETCH 1 (BODY[])
    A14 NO Some messages could not be FETCHed (Failure)
    DEBUG: pool is full, not adding an Authenticated connection
    A15 LOGOUT
    * BYE LOGOUT Requested
    A15 OK 73 good day (Success)
    Exception in thread "SimpleAsyncTaskExecutor-1" org.springframework.integration.MessagingException: failure occurred while receiving from folder
    	at org.springframework.integration.mail.AbstractMailReceiver.receive(AbstractMailReceiver.java:243)
    	at org.springframework.integration.mail.ImapIdleChannelAdapter$IdleTask.run(ImapIdleChannelAdapter.java:120)
    	at java.lang.Thread.run(Thread.java:637)
    Caused by: javax.mail.MessagingException: No content
    	at com.sun.mail.imap.IMAPMessage.writeTo(IMAPMessage.java:672)
    	at javax.mail.internet.MimeMessage.<init>(MimeMessage.java:234)
    	at org.springframework.integration.mail.AbstractMailReceiver.receive(AbstractMailReceiver.java:238)

  • #2
    Same strange behaviour for me, even when using a poller.. I'm using spring-integration 1.0.4 and javamail 1.4.1.
    Any news?
    Thanx!

    Comment


    • #3
      Having the same problem.
      Tried switching to previous versions of Spring Integration but with no success there either.

      Did anyone find the reason for this?

      Thanks,
      Chen.

      Comment


      • #4
        Can you guys upgrade to Spring Integration 2.0 and see if you still have an problem?
        We also have mail sample that shows IDLE with Google. You can compare and see what is different.

        Comment


        • #5
          Doesn't Spring Integration 2.0 require Spring 3.0? I'm currently using Spring 2.5 and cannot upgrade at this point.

          Regarding the sample, can you post the sample or send a link to it?

          Comment


          • #6
            Yes it does, specifically 3.0.5.
            Unfortunately we had some issues with IMAP IDLE that are now fixed.
            you can read more here:
            https://jira.springframework.org/browse/INT-1415
            https://jira.springframework.org/browse/INT-1374
            https://jira.springframework.org/browse/INT-1163

            Comment


            • #7
              Oleg, I tested with Spring 3.0.5 and it works well.
              Unfortunatly upgrading from Spring 2.5.6 to 3.0 is not an option for us at this point. Is there a way to have a fix for Spring Integration 1.x which does not require upgrading to Spring 3.0?

              Comment


              • #8
                I'm glad there has been some progress on this one. I'll upgrade to SI 2 as soon as I can and re-test.

                All the best

                Jon

                Comment


                • #9
                  Great! I just upgraded to 3.0.5 + SI 2.0.0.RELEASE, everything seems to work fine.

                  Comment

                  Working...
                  X