james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <server-...@james.apache.org>
Subject [jira] [Commented] (JAMES-2384) When there is no body, getting a NullPointerException
Date Thu, 26 Apr 2018 02:00:00 GMT

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

ASF GitHub Bot commented on JAMES-2384:
---------------------------------------

Github user provirus commented on the issue:

    https://github.com/apache/james-project/pull/112
  
    FYI, here is the faulty message in the DB. The MAIL_BYTES is not null; just empty and
I cannot reproduce in unit tests, but it always reproduces when using for real.
    
    ```
    INSERT INTO `JAMES_MAIL` (`MAILBOX_ID`, `MAIL_UID`, `MAIL_IS_ANSWERED`, `MAIL_BODY_START_OCTET`,
`MAIL_CONTENT_OCTETS_COUNT`, `MAIL_IS_DELETED`, `MAIL_IS_DRAFT`, `MAIL_IS_FLAGGED`, `MAIL_DATE`,
`MAIL_MIME_TYPE`, `MAIL_MODSEQ`, `MAIL_IS_RECENT`, `MAIL_IS_SEEN`, `MAIL_MIME_SUBTYPE`, `MAIL_TEXTUAL_LINE_COUNT`,
`MAIL_BYTES`, `HEADER_BYTES`) VALUES (1,1,'\0',496,496,'\0','\0','\0','2018-04-25 20:46:50','text',3,'\0','','plain',0,'','Return-Path:
<a2@foilen-lab.com>\r\nMessage-ID: <1465402259.0.1524689210620@localhost>\r\nMIME-Version:
1.0\r\nX-UserIsAuth: true\r\nDelivered-To: a1@foilen-lab.com\r\nReceived: from 192.168.0.114
(EHLO localhost) ([192.168.0.114])\r\n          by james_server (JAMES SMTP Server ) with
ESMTPA ID -164520987\r\n          for <a1@foilen-lab.com>;\r\n          Wed, 25 Apr
2018 20:46:50 +0000 (UTC)\r\nDate: Wed, 25 Apr 2018 16:46:50 -0400\r\nfrom: a2@foilen-lab.com\r\nto:
a1@foilen-lab.com\r\nsubject: test null body\r\n\r\n');
    ```
    
    
    > Could you find exactly which IMAP FETCH command is executed?
    
    Is there a way to find it from the James log since I cannot find a way to know the commands
sent by Thunderbird and Geary?



> When there is no body, getting a NullPointerException
> -----------------------------------------------------
>
>                 Key: JAMES-2384
>                 URL: https://issues.apache.org/jira/browse/JAMES-2384
>             Project: James Server
>          Issue Type: Bug
>          Components: mailbox
>    Affects Versions: master
>            Reporter: Simon Levesque
>            Priority: Minor
>             Fix For: master
>
>
> h1. Steps to reproduce:
> Send an empty email:
> {noformat}
> msmtp --read-envelope-from a2@foilen-lab.com << _EOF
> from: a1@foilen-lab.com
> to: a2@foilen-lab.com
> subject: Empty from msmtp
> _EOF{noformat}
> This email is well sent by msmtp and accepted by James.
>  
> In the client, we can see the email (date, sender, subject), but when we want to see
the body, we are getting this exception since the "body" is null:
> {noformat}
> INFO | jvm 1 | 2018/04/23 22:56:59 | java.lang.NullPointerException
> INFO | jvm 1 | 2018/04/23 22:56:59 | at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMailboxMessage.getBodyContent(JPAMailboxMessage.java:94)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMailboxMessage.getFullContent(AbstractJPAMailboxMessage.java:477)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.mailbox.store.streaming.InputStreamContent.getInputStream(InputStreamContent.java:62)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.fetch.ContentBodyElement.getInputStream(ContentBodyElement.java:60)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imapserver.netty.ChannelImapResponseWriter.write(ChannelImapResponseWriter.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.ImapResponseComposerImpl.literal(ImapResponseComposerImpl.java:312)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.FetchResponseEncoder.encodeBodyElements(FetchResponseEncoder.java:271)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.FetchResponseEncoder.doEncode(FetchResponseEncoder.java:86)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:52)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.chainEncode(AbstractChainedImapEncoder.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.encode.base.AbstractChainedImapEncoder.encode(AbstractChainedImapEncoder.java:54)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.main.ResponseEncoder.respond(ResponseEncoder.java:47)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.fetch.FetchProcessor.processMessageRanges(FetchProcessor.java:167)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.fetch.FetchProcessor.doProcess(FetchProcessor.java:119)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.fetch.FetchProcessor.doProcess(FetchProcessor.java:1)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:110)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.AbstractMailboxProcessor.process(AbstractMailboxProcessor.java:97)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:89)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:1)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:59)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:68)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.apache.james.imapserver.netty.ImapChannelUpstreamHandler.messageReceived(ImapChannelUpstreamHandler.java:196)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:314)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> INFO | jvm 1 | 2018/04/23 22:56:59 | at java.lang.Thread.run(Thread.java:748){noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message