You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Rick McGuire (JIRA)" <ji...@apache.org> on 2008/06/23 14:22:45 UTC

[jira] Commented: (GERONIMO-4144) ArrayIndexOutOfBoundsException on InternetHeaders.addHeaderLine

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

Rick McGuire commented on GERONIMO-4144:
----------------------------------------

I'm not able to reproduce this problem using the provided message text.  From what I'm able to determine, everything seems to be parsing ok.  I'll attach the program I'm using to test this in case I'm missing something. 

> ArrayIndexOutOfBoundsException on InternetHeaders.addHeaderLine
> ---------------------------------------------------------------
>
>                 Key: GERONIMO-4144
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4144
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 2.1.1
>            Reporter: Stefano Bagnara
>            Assignee: Rick McGuire
>         Attachments: message.txt, TestAddHeader.java
>
>
> I get this one when parsing the attached message using this code:
>             byte[] messageBytes = mailString.getBytes("US-ASCII");
>             mm = new MimeMessage(null, new ByteArrayInputStream(
>                     messageBytes));
> (mailString contains the string contained in the txt attachment)
> java.lang.ArrayIndexOutOfBoundsException: -1
> 	at java.util.ArrayList.get(ArrayList.java:324)
> 	at javax.mail.internet.InternetHeaders.addHeaderLine(InternetHeaders.java:538)
> 	at javax.mail.internet.InternetHeaders.load(InternetHeaders.java:124)
> 	at javax.mail.internet.InternetHeaders.<init>(InternetHeaders.java:99)
> 	at javax.mail.internet.MimeMessage.createInternetHeaders(MimeMessage.java:1457)
> 	at javax.mail.internet.MimeMessage.parse(MimeMessage.java:265)
> 	at javax.mail.internet.MimeMessage.<init>(MimeMessage.java:153)
> 	at org.apache.james.imapserver.codec.decode.imap4rev1.AppendCommandParser.mimeMessage(AppendCommandParser.java:102)
> 	at org.apache.james.imapserver.codec.decode.imap4rev1.AppendCommandParser.decode(AppendCommandParser.java:123)
> 	at org.apache.james.imapserver.codec.decode.base.AbstractImapCommandParser.parse(AbstractImapCommandParser.java:112)
> 	at org.apache.james.imapserver.codec.decode.main.DefaultImapDecoder.decodeCommandNamed(DefaultImapDecoder.java:113)
> 	at org.apache.james.imapserver.codec.decode.main.DefaultImapDecoder.decodeCommandTagged(DefaultImapDecoder.java:81)
> 	at org.apache.james.imapserver.codec.decode.main.DefaultImapDecoder.decode(DefaultImapDecoder.java:60)
> 	at org.apache.james.experimental.imapserver.ImapRequestHandler.doProcessRequest(ImapRequestHandler.java:136)
> 	at org.apache.james.experimental.imapserver.ImapRequestHandler.handleRequest(ImapRequestHandler.java:99)
> 	at org.apache.james.experimental.imapserver.ExperimentalHostSystem$Session.readLine(ExperimentalHostSystem.java:247)
> 	at org.apache.james.test.functional.imap.ProtocolSession$ServerResponse.readLine(ProtocolSession.java:331)
> 	at org.apache.james.test.functional.imap.ProtocolSession$ServerResponse.checkResponse(ProtocolSession.java:295)
> 	at org.apache.james.test.functional.imap.ProtocolSession$ServerResponse.testProtocol(ProtocolSession.java:285)
> 	at org.apache.james.test.functional.imap.ProtocolSession.runSessions(ProtocolSession.java:86)
> 	at org.apache.james.test.functional.imap.AbstractProtocolTest.runSessions(AbstractProtocolTest.java:100)
> 	at org.apache.james.test.functional.imap.SimpleScriptedTestProtocol.scriptTest(SimpleScriptedTestProtocol.java:68)
> 	at org.apache.james.test.functional.imap.AbstractTestUidSearch.testSearchAtomsUS(AbstractTestUidSearch.java:33)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.