-
Bug
-
Resolution: Fixed
-
Low
andreask@atlassian.com picked up on what was going on here, from his comment on the support case where this was discovered:
- Add a comment with a security level that certain users are allowed to see and other users aren't allowed to see due to the security level (those other users should have permission to browse the issue though!)
- Edit that comment and remove the security level. We should now send a notification to all users with browse permission, including the ones that didn't have permission to see the comment previously due to the security level that was set
- The null pointer exception occurs I think because we remove the originalcomment from the velocity context for users that didn't have permission previously to see it. When we try to diff the original comment with the new comment for those new users we get a NPE since the original is not provided.
The diff to the previous comment shouldn't occur if there's no original.
The stack trace in the logs looks like this:
2013-08-07 07:08:13,453 Sending mailitem com.atlassian.jira.mail.IssueMailQueueItem@1675db2[issue=com.atlassian.jira.issue.IssueImpl@e397e9[id=10490,summary=Summary,key=ABC-123,created=2013-06-03 11:07:25.8,updated=2013-08-07 07:06:48.701,assignee=User:2,reporter=sysadmin:2],remoteUser=User:2,notificationType=Current_Reporter,eventTypeId=14,templateId=14] ERROR ServiceRunner Mail Queue Service [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.NullPointerException java.lang.NullPointerException at java.util.regex.Matcher.getTextLength(Matcher.java:1140) at java.util.regex.Matcher.reset(Matcher.java:291) at java.util.regex.Matcher.<init>(Matcher.java:211) at java.util.regex.Pattern.matcher(Pattern.java:888) at com.atlassian.diff.WordLevelDiffer.tokenize(WordLevelDiffer.java:153) at com.atlassian.diff.WordLevelDiffer.diffLine(WordLevelDiffer.java:72) at com.atlassian.diff.DiffViewBean.createWordLevelDiff(DiffViewBean.java:123) at com.atlassian.jira.mail.DiffUtils.diff(DiffUtils.java:23) at sun.reflect.GeneratedMethodAccessor1256.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:381) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:370) at com.atlassian.velocity.htmlsafe.introspection.UnboxingMethod.invoke(UnboxingMethod.java:30) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:507) at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71) at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336) at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1277) at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216) at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1165) at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:219) at com.atlassian.velocity.DefaultVelocityManager.writeEncodedBodyForContent(DefaultVelocityManager.java:86) at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.toWriterImpl(DefaultVelocityTemplatingEngine.java:157) at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.asPlainText(DefaultVelocityTemplatingEngine.java:128) at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest$1.with(DefaultVelocityTemplatingEngine.java:108) at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest$StringRepresentation.toString(DefaultVelocityTemplatingEngine.java:88) at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.asPlainText(DefaultVelocityTemplatingEngine.java:104) at com.atlassian.jira.mail.MailingListCompiler$1.processRecipient(MailingListCompiler.java:307) at com.atlassian.jira.mail.NotificationRecipientProcessor.process(NotificationRecipientProcessor.java:39) at com.atlassian.jira.mail.MailingListCompiler.addMailsToQueue(MailingListCompiler.java:337) at com.atlassian.jira.mail.MailingListCompiler.access$400(MailingListCompiler.java:47) at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.addEmailsToQueue(MailingListCompiler.java:495) at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendLists(MailingListCompiler.java:465) at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendNoLevelsIgnoreGroup(MailingListCompiler.java:445) at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendForEvent(MailingListCompiler.java:434) at com.atlassian.jira.mail.MailingListCompiler.sendLists(MailingListCompiler.java:140) at com.atlassian.jira.mail.IssueMailQueueItem.send(IssueMailQueueItem.java:149) at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:66) at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:28) 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)
And the one in the email that arrives:
An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'diff' in class com.atlassian.jira.mail.DiffUtils threw exception java.lang.NullPointerException at getEncodedBodyFromContent[line 6, column 34] at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:337) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:284) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:507) at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71) at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336) at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1277) at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216) at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1165) at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:219) at com.atlassian.velocity.DefaultVelocityManager.writeEncodedBodyForContent(DefaultVelocityManager.java:86) at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.toWriterImpl(DefaultVelocityTemplatingEngine.java:157) at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.asPlainText(DefaultVelocityTemplatingEngine.java:128) at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest$1.with(DefaultVelocityTemplatingEngine.java:108) at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest$StringRepresentation.toString(DefaultVelocityTemplatingEngine.java:88) at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.asPlainText(DefaultVelocityTemplatingEngine.java:104) at com.atlassian.jira.mail.MailingListCompiler$1.processRecipient(MailingListCompiler.java:307) at com.atlassian.jira.mail.NotificationRecipientProcessor.process(NotificationRecipientProcessor.java:39) at com.atlassian.jira.mail.MailingListCompiler.addMailsToQueue(MailingListCompiler.java:337) at com.atlassian.jira.mail.MailingListCompiler.access$400(MailingListCompiler.java:47) at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.addEmailsToQueue(MailingListCompiler.java:495) at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendLists(MailingListCompiler.java:465) at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendNoLevelsIgnoreGroup(MailingListCompiler.java:445) at com.atlassian.jira.mail.MailingListCompiler$NotificationCompiler.sendForEvent(MailingListCompiler.java:434) at com.atlassian.jira.mail.MailingListCompiler.sendLists(MailingListCompiler.java:140) at com.atlassian.jira.mail.IssueMailQueueItem.send(IssueMailQueueItem.java:149) at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:66) at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:28) 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) Caused by: java.lang.NullPointerException at java.util.regex.Matcher.getTextLength(Matcher.java:1140) at java.util.regex.Matcher.reset(Matcher.java:291) at java.util.regex.Matcher.<init>(Matcher.java:211) at java.util.regex.Pattern.matcher(Pattern.java:888) at com.atlassian.diff.WordLevelDiffer.tokenize(WordLevelDiffer.java:153) at com.atlassian.diff.WordLevelDiffer.diffLine(WordLevelDiffer.java:72) at com.atlassian.diff.DiffViewBean.createWordLevelDiff(DiffViewBean.java:123) at com.atlassian.jira.mail.DiffUtils.diff(DiffUtils.java:23) at sun.reflect.GeneratedMethodAccessor5065.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:381) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:370) at com.atlassian.velocity.htmlsafe.introspection.UnboxingMethod.invoke(UnboxingMethod.java:30) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270) ... 31
- is duplicated by
-
JRACLOUD-66156 Exception stack trace emailed when an Issue comment is edited
- Closed
- is cloned from
-
JRADEV-23807 Loading...
- mentioned in
-
Page Loading...