java.lang.NullPointerException

Atlassian JIRA | Jaiden Ashmore [On leave until 19th September] | 4 years ago
  1. 0

    This is a bug found while triaging: https://support.atlassian.com/browse/JST-60176 Since the latest upgrade of the JIRA OnDemand instance the AttachmentManager has been broken while attaching files to comments. h4. Stack Trace {code} 2013-03-26 15:49:42,902 ERROR [SupportEmails] QuartzScheduler_Worker-2 ServiceRunner Support Emails Exception while creating attachment for issue SPT-5008: java.lang.NullPointerException java.lang.NullPointerException at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachmentBean(DefaultAttachmentManager.java:409) at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:378) at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:371) at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:462) at com.atlassian.jira.service.util.handler.DefaultMessageHandlerContext.createAttachment(DefaultMessageHandlerContext.java:83) at com.atlassian.jira.service.services.mail.DelegatingMessageHandlerContext.createAttachment(DelegatingMessageHandlerContext.java:53) at com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler.createAttachmentWithPart(AbstractMessageHandler.java:978) at com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler$1.handlePart(AbstractMessageHandler.java:572) at com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler.handleMultipart(AbstractMessageHandler.java:661) at com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler.createAttachmentsForMessage(AbstractMessageHandler.java:622) at com.atlassian.jira.plugins.mail.handlers.AbstractCommentHandler.handleMessage(AbstractCommentHandler.java:138) at com.atlassian.jira.plugins.mail.handlers.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:112) at com.atlassian.jira.service.services.mail.MailFetcherService$1.process(MailFetcherService.java:368) at com.atlassian.jira.service.services.mail.MailFetcherService$MessageProviderImpl.getAndProcessMail(MailFetcherService.java:271) at com.atlassian.jira.service.services.mail.MailFetcherService.runImpl(MailFetcherService.java:356) at com.atlassian.jira.service.services.file.AbstractMessageHandlingService.run(AbstractMessageHandlingService.java:257) at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61) at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48) at org.quartz.core.JobRunShell.run(JobRunShell.java:195) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) {code} h4. Possible Culprit Commit cc920660309f76fbf94a1be86f03c779e1fd740c h4. Cause of exception In file DefaultAttachmentManager.java on line 408/409 an attachment is create using the createAttachment function found on line 412. This function can return null, e.g. if the file or filename is null, therefore on line 409 when they try to call getId on the variable 'attachment' a null pointer exception is thrown as attachment is null. h4. Advice CreateAttachment functions need to be cleaned up, I could not understand what was going on as there are 10 createAttachment functions and so could not figure out a workaround, therefore pushing this quickly would be appreciative for the customer.

    Atlassian JIRA | 4 years ago | Jaiden Ashmore [Atlassian]
    java.lang.NullPointerException
  2. 0

    This is a bug found while triaging: https://support.atlassian.com/browse/JST-60176 Since the latest upgrade of the JIRA OnDemand instance the AttachmentManager has been broken while attaching files to comments. h4. Stack Trace {code} 2013-03-26 15:49:42,902 ERROR [SupportEmails] QuartzScheduler_Worker-2 ServiceRunner Support Emails Exception while creating attachment for issue SPT-5008: java.lang.NullPointerException java.lang.NullPointerException at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachmentBean(DefaultAttachmentManager.java:409) at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:378) at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:371) at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:462) at com.atlassian.jira.service.util.handler.DefaultMessageHandlerContext.createAttachment(DefaultMessageHandlerContext.java:83) at com.atlassian.jira.service.services.mail.DelegatingMessageHandlerContext.createAttachment(DelegatingMessageHandlerContext.java:53) at com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler.createAttachmentWithPart(AbstractMessageHandler.java:978) at com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler$1.handlePart(AbstractMessageHandler.java:572) at com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler.handleMultipart(AbstractMessageHandler.java:661) at com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler.createAttachmentsForMessage(AbstractMessageHandler.java:622) at com.atlassian.jira.plugins.mail.handlers.AbstractCommentHandler.handleMessage(AbstractCommentHandler.java:138) at com.atlassian.jira.plugins.mail.handlers.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:112) at com.atlassian.jira.service.services.mail.MailFetcherService$1.process(MailFetcherService.java:368) at com.atlassian.jira.service.services.mail.MailFetcherService$MessageProviderImpl.getAndProcessMail(MailFetcherService.java:271) at com.atlassian.jira.service.services.mail.MailFetcherService.runImpl(MailFetcherService.java:356) at com.atlassian.jira.service.services.file.AbstractMessageHandlingService.run(AbstractMessageHandlingService.java:257) at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61) at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48) at org.quartz.core.JobRunShell.run(JobRunShell.java:195) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) {code} h4. Possible Culprit Commit cc920660309f76fbf94a1be86f03c779e1fd740c h4. Cause of exception In file DefaultAttachmentManager.java on line 408/409 an attachment is create using the createAttachment function found on line 412. This function can return null, e.g. if the file or filename is null, therefore on line 409 when they try to call getId on the variable 'attachment' a null pointer exception is thrown as attachment is null. h4. Advice CreateAttachment functions need to be cleaned up, I could not understand what was going on as there are 10 createAttachment functions and so could not figure out a workaround, therefore pushing this quickly would be appreciative for the customer.

    Atlassian JIRA | 4 years ago | Jaiden Ashmore [On leave until 19th September]
    java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Hello, Since upgrading to JIRA 3.6 Enterprise (standalone) over the weekend, the e-mail handler that helps create and comment on issues has a problem where it keeps posting the same comments over and over again. From what I see, the user replies to an e-mail to add a comment made in a reported JIRA issue, but it appears that JIRA is not cleaning up the message off from the mail server once it processes. Becaus of this, we keep getting the same message over and over again until I can manually delete it off myself from the mail server. Looking at the log, here's what I see: 2006-05-05 07:22:56,793 WARN [jira.issue.managers.DefaultAttachmentManager] Creating attachment without a file. Aborting 2006-05-05 07:22:56,825 ERROR [service.util.handler.AbstractMessageHandler] Exception while creating attachment for issue IQ-3400: java.lang.NullPointerException java.lang.NullPointerException at com.atlassian.jira.issue.history.ChangeLogUtils.createChangeGroup(ChangeLogUtils.java:85) at com.atlassian.jira.issue.util.DefaultIssueUpdater.doUpdate(DefaultIssueUpdater.java:55) at com.atlassian.jira.service.util.handler.AbstractCommentHandler.addChangeHistoryItem(AbstractCommentHandler.java:122) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.createAttachmentWithPart(AbstractMessageHandler.java:255) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.handleMultipart(AbstractMessageHandler.java:209) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.createAttachmentsForMessage(AbstractMessageHandler.java:192) at com.atlassian.jira.service.util.handler.AbstractCommentHandler.handleMessage(AbstractCommentHandler.java:90) at com.atlassian.jira.service.util.handler.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:100) at com.atlassian.jira.service.services.mail.MailFetcherService.run(MailFetcherService.java:184) at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61) at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48) at org.quartz.core.JobRunShell.run(JobRunShell.java:191) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516) 2006-05-05 07:22:56,825 WARN [service.util.handler.AbstractCommentHandler] Exception creating comment null java.io.IOException at com.atlassian.jira.service.util.handler.AbstractMessageHandler.createAttachmentWithPart(AbstractMessageHandler.java:262) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.handleMultipart(AbstractMessageHandler.java:209) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.createAttachmentsForMessage(AbstractMessageHandler.java:192) at com.atlassian.jira.service.util.handler.AbstractCommentHandler.handleMessage(AbstractCommentHandler.java:90) at com.atlassian.jira.service.util.handler.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:100) at com.atlassian.jira.service.services.mail.MailFetcherService.run(MailFetcherService.java:184) at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61) at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48) at org.quartz.core.JobRunShell.run(JobRunShell.java:191) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516) The same block appears over and over again in the log, until I remove the offending message from the mail server. We never had any problems before JIRA 3.6 and I don't see anything special about the e-mail message that causes it to get "stuck" in the mail queue since it was just a comment with no attachments. Any help is appreciated. Nordy Isaac

    Atlassian JIRA | 1 decade ago | Nordy Isaac
    java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachmentBean()
    2. com.atlassian.jira
      ServiceRunner.execute
      1. com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachmentBean(DefaultAttachmentManager.java:409)
      2. com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:378)
      3. com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:371)
      4. com.atlassian.jira.issue.managers.DefaultAttachmentManager.createAttachment(DefaultAttachmentManager.java:462)
      5. com.atlassian.jira.service.util.handler.DefaultMessageHandlerContext.createAttachment(DefaultMessageHandlerContext.java:83)
      6. com.atlassian.jira.service.services.mail.DelegatingMessageHandlerContext.createAttachment(DelegatingMessageHandlerContext.java:53)
      7. com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler.createAttachmentWithPart(AbstractMessageHandler.java:978)
      8. com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler$1.handlePart(AbstractMessageHandler.java:572)
      9. com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler.handleMultipart(AbstractMessageHandler.java:661)
      10. com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler.createAttachmentsForMessage(AbstractMessageHandler.java:622)
      11. com.atlassian.jira.plugins.mail.handlers.AbstractCommentHandler.handleMessage(AbstractCommentHandler.java:138)
      12. com.atlassian.jira.plugins.mail.handlers.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:112)
      13. com.atlassian.jira.service.services.mail.MailFetcherService$1.process(MailFetcherService.java:368)
      14. com.atlassian.jira.service.services.mail.MailFetcherService$MessageProviderImpl.getAndProcessMail(MailFetcherService.java:271)
      15. com.atlassian.jira.service.services.mail.MailFetcherService.runImpl(MailFetcherService.java:356)
      16. com.atlassian.jira.service.services.file.AbstractMessageHandlingService.run(AbstractMessageHandlingService.java:257)
      17. com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61)
      18. com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48)
      18 frames
    3. quartz
      SimpleThreadPool$WorkerThread.run
      1. org.quartz.core.JobRunShell.run(JobRunShell.java:195)
      2. org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
      2 frames