jira-git-plugin icon indicating copy to clipboard operation
jira-git-plugin copied to clipboard

Exception with first commit on an empty repo

Open christarento opened this issue 12 years ago • 2 comments

It seems that we got an exception when the first commit add some Jira reference in message. As this is the first commit, there is no parent commit, it seems to raise an exception when gitweb view is activated ...

trace:

2012-06-27 23:01:51,140 http-8080-11 ERROR admin 1381x3999x1 1mw7kdq 192.168.1.50,127.0.0.1 /browse/TEST [velocity] Method getChangePathLink threw exception for reference $commit in template templates/plugins/git/projecttabpanels/git-project-tab.vm at [128,29] 2012-06-27 23:01:51,140 http-8080-11 ERROR admin 1381x3999x1 1mw7kdq 192.168.1.50,127.0.0.1 /browse/TEST [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.ArrayIndexOutOfBoundsException: 0 java.lang.ArrayIndexOutOfBoundsException: 0 at org.eclipse.jgit.revwalk.RevCommit.getParent(RevCommit.java:285) at com.xiplink.jira.git.linkrenderer.LinkFormatRenderer.getChangePathLink(LinkFormatRenderer.java:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:234) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:203) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:220) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55) at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:166) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55) at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:166) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:70) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230) at org.apache.velocity.Template.merge(Template.java:256) at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:422) at com.atlassian.velocity.DefaultVelocityManager.getEncodedBody(DefaultVelocityManager.java:77) at com.atlassian.velocity.DefaultVelocityManager.getEncodedBody(DefaultVelocityManager.java:61) at com.atlassian.velocity.DefaultVelocityManager.getEncodedBody(DefaultVelocityManager.java:56) at com.atlassian.jira.plugin.AbstractJiraModuleDescriptor.getHtml(AbstractJiraModuleDescriptor.java:109) at com.xiplink.jira.git.projecttabpanels.GitProjectTabPanel.getHtml(GitProjectTabPanel.java:130) at com.atlassian.jira.web.action.browser.BrowseProject.getTabHtml(BrowseProject.java:275) at com.atlassian.jira.web.action.browser.BrowseProject.getTabHtmlForJSON(BrowseProject.java:244) at sun.reflect.GeneratedMethodAccessor773.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70) at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56) at webwork.util.ValueStack.findValue(ValueStack.java:414)

christarento avatar Jun 27 '12 21:06 christarento

It seems to be a known bug of JGit see https://git.eclipse.org/r/#/c/1624/

Is it possible to update JGit ?

christarento avatar Jun 27 '12 21:06 christarento

quite easily, it's just a matter of changing the version of the jgit dependency within pom.xml and install, but from the issue above it looks like the fix should be already in the version 0.10.1 currently used

mteodori avatar Jun 27 '12 23:06 mteodori