Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-2384

When there is no body, getting a NullPointerException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: master
    • Fix Version/s: master
    • Component/s: mailbox
    • Labels:
      None

      Description

      Steps to reproduce:

      Send an empty email:

      msmtp --read-envelope-from a2@foilen-lab.com << _EOF
      from: a1@foilen-lab.com
      to: a2@foilen-lab.com
      subject: Empty from msmtp
      _EOF

      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:

      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)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                simonl Simon Levesque
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: