james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <mime4j-...@james.apache.org>
Subject [jira] [Commented] (MIME4J-235) NPE during parsing of an message
Date Tue, 07 Jan 2014 13:17:50 GMT

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

Oleg Kalnichevski commented on MIME4J-235:
------------------------------------------

Mariano

I am unable to reproduce the NPE neither using 0.7.2 nor the latest snapshot off trunk using
the following test app

{code:java}
File file = new File("c:\\data\\error-205-NullPointerException.mbox");
ContentHandler handler = new AbstractContentHandler() {

    @Override
    public void startMessage() throws MimeException {
        super.startMessage();
        System.out.println("Start message");
    }

    @Override
    public void endMessage() throws MimeException {
        super.endMessage();
        System.out.println("End message");
    }
};

MimeConfig config = MimeConfig.DEFAULT;
MimeStreamParser parser = new MimeStreamParser(config);
parser.setContentHandler(handler);
InputStream instream = new FileInputStream(file);
try {
    parser.parse(instream);
} finally {
    instream.close();
}
{code}

Could you please also provide a unit test / test app that can reproduce the issue?

Oleg

> NPE during parsing of an message
> --------------------------------
>
>                 Key: MIME4J-235
>                 URL: https://issues.apache.org/jira/browse/MIME4J-235
>             Project: James Mime4j
>          Issue Type: Bug
>          Components: parser (core)
>    Affects Versions: 0.8.0
>            Reporter: Mariano Kamp
>         Attachments: error-205-NullPointerException.mbox, error-95-NullPointerException.mbox
>
>
> Ran into an NPE. Reported it to the mailing list, was referred to here.
> http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/201401.mbox/browser
> The linked message also contains the offending mail as well as the full strack trace.
> Don't see how I could upload the file here.
> java.lang.NullPointerException
> at
> org.apache.james.mime4j.io.MimeBoundaryInputStream.<init>(MimeBoundaryInputStream.java:67)
> at
> org.apache.james.mime4j.stream.MimeEntity.createMimePartStream(MimeEntity.java:366)
> at
> org.apache.james.mime4j.stream.MimeEntity.advance(MimeEntity.java:320)
> at
> org.apache.james.mime4j.stream.MimeTokenStream.next(MimeTokenStream.java:368)
> at
> org.apache.james.mime4j.parser.MimeStreamParser.parse(MimeStreamParser.java:176)
> at
> org.apache.james.mime4j.message.DefaultMessageBuilder.parseMessage(DefaultMessageBuilder.java:316)
> at com.mboxanalytics.util.MboxUtil.parseMessage(MboxUtil.java:95)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message