|
|
|
The NPE issue in RESTful API is a bug and we will get it fixed. However the error raised in custom_html_notification.vm is caused by your custom code, and to fixe it, you may need to check nullability of relevant objects to avoid calling getCommitters on it (most probably you are calling getCommitters on a repository that does not exist anymore).
Thanks for looking into this.
We will check our template. We try to get the committers of a build not of a single repository. Also the Exception states that this exception occurs inside of getCommitters() of the class Build. Sadly the cause in the stacktrace is truncated. It may be unrelated to this issue but I think the problem is somewhere in the Build model class. Another question: Is there any chance to get something like groovy templates as alternative to velocity templates? I mean the last velocity update was 2010 and we use groovy a lot so that would ease the template creation. Thank you. I found a stacktrace which is not truncated from the template parsing:
2015-04-23 18:23:16,244 [pool-1-thread-5571] ERROR org.apache.velocity.runtime.directive.Parse - Exception rendering #parse( tml_notification.vm) at velocity[line 1, column 1] 2015-04-23 18:23:16,250 [pool-1-thread-5571] ERROR com.pmease.quickbuild.DefaultBuildEngine - Error processing build request. com.pmease.quickbuild.QuickbuildException: Failed to evaluate Velocity template. at com.pmease.quickbuild.util.ExceptionUtils.wrapException(ExceptionUtils.java:89) at com.pmease.quickbuild.util.VelocityUtils.evalTemplate(VelocityUtils.java:44) at com.pmease.quickbuild.plugin.notifier.email.EmailNotifier.notify(EmailNotifier.java:113) at com.pmease.quickbuild.DefaultBuildEngine.sendNotifications(DefaultBuildEngine.java:898) at com.pmease.quickbuild.DefaultBuildEngine.process(DefaultBuildEngine.java:414) at com.pmease.quickbuild.DefaultBuildEngine.access$000(DefaultBuildEngine.java:131) at com.pmease.quickbuild.DefaultBuildEngine$2.run(DefaultBuildEngine.java:1076) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getCommitters' in class com.pmease.quickbuild.model.Build threw exception java.lang.NullPointerException at custom_html_notification.vm[line 115, column 48] at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:223) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567) at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:318) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1378) at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1314) at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1265) at org.apache.velocity.app.Velocity.evaluate(Velocity.java:180) at com.pmease.quickbuild.util.VelocityUtils.evalTemplate(VelocityUtils.java:41) ... 10 more Caused by: java.lang.NullPointerException at com.pmease.quickbuild.plugin.report.changes.rest.ChangesetMapper.handle(ChangesetMapper.java:47) at com.pmease.quickbuild.plugin.report.changes.rest.ChangesetMapper.handle(ChangesetMapper.java:18) at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:396) at com.pmease.quickbuild.plugin.report.engine.datastore.DbStore.query(DbStore.java:87) at com.pmease.quickbuild.plugin.report.engine.datastore.DbStore.query(DbStore.java:59) at com.pmease.quickbuild.plugin.report.changes.ChangesHelper.getBuildChangesets(ChangesHelper.java:283) at com.pmease.quickbuild.plugin.report.changes.generator.DefaultChangesRecorder.read(DefaultChangesRecorder.java:53) at com.pmease.quickbuild.ServerServiceImpl.readChanges(ServerServiceImpl.java:271) at com.pmease.quickbuild.model.Build.getChanges(Build.java:616) at com.pmease.quickbuild.model.Build.getCommitters(Build.java:750) at sun.reflect.GeneratedMethodAccessor755.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java:142) at org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:539) at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:198) ... 27 more Here you can see it is the exact same problem.
|
seems like this is the cause for the NPE