geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bjorn Danielsson (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (GERONIMO-6421) org.apache.geronimo.javamail.util.InvalidCommandException: Unexpected command IMAP command error
Date Sun, 17 Mar 2013 18:01:15 GMT

    [ https://issues.apache.org/jira/browse/GERONIMO-6421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13604694#comment-13604694
] 

Bjorn Danielsson edited comment on GERONIMO-6421 at 3/17/13 6:00 PM:
---------------------------------------------------------------------

I get a similar problem when connecting to Dovecot using AUTHENTICATION PLAIN.

Exception in thread "main" 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:410)
        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:598)
        at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.processPlainAuthentication(IMAPConnection.java:537)
        at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.login(IMAPConnection.java:488)
        at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.protocolConnect(IMAPConnection.java:176)
        [...]

The problem is easily reproduced by faking an IMAP server like this:

perl -pe '$|=1;chomp;$_.="\r\n"' | sudo nc -l 143

And then entering the IMAP-server responses manually:

{panel}
* OK Foobar ready.
* CAPABILITY IMAP4rev1 AUTH=PLAIN AUTH=LOGIN
a0 OK Capability completed.
+ 
{panel}

                
      was (Author: cuspycode):
    I get a similar problem when connecting to Dovecot using AUTHENTICATION PLAIN.

Exception in thread "main" 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:410)
        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:598)
        at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.processPlainAuthentication(IMAPConnection.java:537)
        at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.login(IMAPConnection.java:488)
        at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.protocolConnect(IMAPConnection.java:176)
        [...]

The problem is easily reproduced by faking an IMAP server like this:

perl -pe '$|=1;chomp;$_.="\r\n"' | sudo nc -l 143

And then entering the IMAP-server responses manually:

<pre>
* OK Foobar ready.
* CAPABILITY IMAP4rev1 AUTH=PLAIN AUTH=LOGIN
a0 OK Capability completed.
+ 
</pre>

                  
> org.apache.geronimo.javamail.util.InvalidCommandException: Unexpected command IMAP command
error
> ------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-6421
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6421
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>         Environment: TomEE 1.5.1
> geronimo-javamail_1.4_mail-1.8.2.jar
> Windows Server 2003/2008
>            Reporter: Howard W. Smith, Jr.
>
> The code below works just fine in a @Stateless bean (which is invoked by @Schedule),
running on Glassfish3.1.2.2, and now, I just confirmed that this code works when I replace
geronimo-javamail_1.4_mail-1.8.2.jar (bundled with TomEE 1.5.1) with oracle/sun's javamail
JAR.
>             props = System.getProperties();
>             props.setProperty("mail.store.protocol", "imaps");
>             //session = Session.getDefaultInstance(props, null);
>             session = Session.getInstance(props);
>             store = session.getStore("imaps");
>             store.connect("imap.gmail.com", "username@gmail.com", "password");
> I attempted the above code in TomEE 1.5.1 (using geronimo-javamail_1.4_mail-1.8.2.jar),
but the result was the exception below. 
> org.apache.geronimo.javamail.util.InvalidCommandException: Unexpected command IMAP command
error
> 	at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.receiveResponse(IMAPConnection.java:411)
> 	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:567)
> 	at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.login(IMAPConnection.java:500)
> 	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:251)
> 	at javax.mail.Service.connect(Service.java:91)
> 	at utils.mail.EmailHandler.initialize(EmailHandler.java:62)
> 	at utils.mail.EmailStatelessBean.getEmails(EmailStatelessBean.java:45)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> 	at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:128)
> 	at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:43)
> 	at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:64)
> 	at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:70)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> 	at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)
> 	at org.apache.openejb.monitoring.StatsInterceptor.AroundTimeout(StatsInterceptor.java:140)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> 	at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:237)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:189)
> 	at org.apache.openejb.core.timer.EjbTimerServiceImpl.ejbTimeout(EjbTimerServiceImpl.java:569)
> 	at org.apache.openejb.core.timer.EjbTimeoutJob.execute(EjbTimeoutJob.java:39)
> 	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:722)
> Dec 08, 2012 9:56:20 PM pf.ApplicationScopeBean log
> INFO: EmailStatelessBean.getEmails(): Error initializing GMAIL IMAP session.
> javax.mail.MessagingException: Not connected 
> 	at org.apache.geronimo.javamail.store.imap.IMAPStore.checkConnectionStatus(IMAPStore.java:353)
> 	at org.apache.geronimo.javamail.store.imap.IMAPStore.getDefaultFolder(IMAPStore.java:204)
> 	at org.apache.geronimo.javamail.store.imap.IMAPStore.getFolder(IMAPStore.java:224)
> 	at utils.mail.EmailHandler.getMessagesFromFolder(EmailHandler.java:130)
> 	at utils.mail.EmailHandler.loadEmailsFromInbox(EmailHandler.java:113)
> 	at utils.mail.EmailStatelessBean.getEmails(EmailStatelessBean.java:52)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> 	at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:128)
> 	at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:43)
> 	at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:64)
> 	at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:70)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> 	at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)
> 	at org.apache.openejb.monitoring.StatsInterceptor.AroundTimeout(StatsInterceptor.java:140)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> 	at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:237)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:189)
> 	at org.apache.openejb.core.timer.EjbTimerServiceImpl.ejbTimeout(EjbTimerServiceImpl.java:569)
> 	at org.apache.openejb.core.timer.EjbTimeoutJob.execute(EjbTimeoutJob.java:39)
> 	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:722)
> Dec 08, 2012 9:56:20 PM pf.ApplicationScopeBean log
> INFO: EmailStatelessBean.getEmails(): Error loading emails from Inbox
> Dec 08, 2012 9:58:00 PM pf.ApplicationScopeBean log
> INFO: EmailStatelessBean.getEmails(): invoked Sat Dec 08 21:58:00 EST 2012
> org.apache.geronimo.javamail.util.InvalidCommandException: Unexpected command IMAP command
error
> 	at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.receiveResponse(IMAPConnection.java:411)
> 	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:567)
> 	at org.apache.geronimo.javamail.store.imap.connection.IMAPConnection.login(IMAPConnection.java:500)
> 	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:251)
> 	at javax.mail.Service.connect(Service.java:91)
> 	at utils.mail.EmailHandler.initialize(EmailHandler.java:62)
> 	at utils.mail.EmailStatelessBean.getEmails(EmailStatelessBean.java:45)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> 	at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:128)
> 	at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:43)
> 	at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:64)
> 	at org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:70)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> 	at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)
> 	at org.apache.openejb.monitoring.StatsInterceptor.AroundTimeout(StatsInterceptor.java:140)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> 	at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:237)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:189)
> 	at org.apache.openejb.core.timer.EjbTimerServiceImpl.ejbTimeout(EjbTimerServiceImpl.java:569)
> 	at org.apache.openejb.core.timer.EjbTimeoutJob.execute(EjbTimeoutJob.java:39)
> 	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:722)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message