Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21450

NPE on "Selected Module Last Version" when Jenkins Job Name != artifactId

    Details

    • Similar Issues:

      Description

      Jan 21, 2014 4:55:55 PM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: it.getVersion(job) in /view/WIP/. Reason: java.lang.NullPointerException
      java.lang.NullPointerException
              at jenkins.plugins.maveninfo.columns.LastVersionColumn.getModulePattern(LastVersionColumn.java:101)
              at jenkins.plugins.maveninfo.columns.LastVersionColumn.getVersion(LastVersionColumn.java:113)
              at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
              at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
              at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
              at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
              at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
              at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
              at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74)
              at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:58)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
              at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81)
              at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
              at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      

      The exception seems to be caused by the fact that the Jenkins Job name is different from the actual POM's artifactId and it tries to use the former to get the version of the latter.

      Attached patch fixes the issue for me but I'm unsure if this is the correct way to go about it. It does seem to fix the issue for us though for both single and multi-module Maven projects.

      If this is the/a correct fix I can send a pull request if you prefer.

        Attachments

          Activity

          Hide
          emenaceb Emilio Jose Mena Cebrian added a comment -

          which version of plugin?

          I can't find a version with this stacktrace

          at jenkins.plugins.maveninfo.columns.LastVersionColumn.getModulePattern(LastVersionColumn.java:101)
          at jenkins.plugins.maveninfo.columns.LastVersionColumn.getVersion(LastVersionColumn.java:113)

          Show
          emenaceb Emilio Jose Mena Cebrian added a comment - which version of plugin? I can't find a version with this stacktrace at jenkins.plugins.maveninfo.columns.LastVersionColumn.getModulePattern(LastVersionColumn.java:101) at jenkins.plugins.maveninfo.columns.LastVersionColumn.getVersion(LastVersionColumn.java:113)
          Hide
          marelooke Bert Geens added a comment - - edited

          Hmm, I probably messed up and used a build with additional debug statements, my apologies for that.

          This is the exception with a vanilla 0.1.2 plugin form the update center (double checked it this time):

          Jan 28, 2014 10:48:01 AM hudson.ExpressionFactory2$JexlExpression evaluate
          WARNING: Caught exception evaluating: it.getVersion(job) in /view/WIP/. Reason: java.lang.NullPointerException
          java.lang.NullPointerException
                  at jenkins.plugins.maveninfo.columns.LastVersionColumn.getModulePattern(LastVersionColumn.java:100)
                  at jenkins.plugins.maveninfo.columns.LastVersionColumn.getVersion(LastVersionColumn.java:105)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:606)
                  at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
                  at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
                  at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
                  at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
                  at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
                  at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
                  at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74)
                  at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:58)
                  at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
                  at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
                  at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
                  at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81)
          

          It doesn't seem to happen with the latest version from Git anymore, so it seems cb9649c has fixed it.

          Show
          marelooke Bert Geens added a comment - - edited Hmm, I probably messed up and used a build with additional debug statements, my apologies for that. This is the exception with a vanilla 0.1.2 plugin form the update center (double checked it this time): Jan 28, 2014 10:48:01 AM hudson.ExpressionFactory2$JexlExpression evaluate WARNING: Caught exception evaluating: it.getVersion(job) in /view/WIP/. Reason: java.lang.NullPointerException java.lang.NullPointerException at jenkins.plugins.maveninfo.columns.LastVersionColumn.getModulePattern(LastVersionColumn.java:100) at jenkins.plugins.maveninfo.columns.LastVersionColumn.getVersion(LastVersionColumn.java:105) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258) at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80) at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:58) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81) It doesn't seem to happen with the latest version from Git anymore, so it seems cb9649c has fixed it.
          Hide
          emenaceb Emilio Jose Mena Cebrian added a comment -

          I'm not sure if it's fixed

          The exception is thrown due to a null Job's configuration and I haven't found a reproducible conditions in which it's thrown

          Show
          emenaceb Emilio Jose Mena Cebrian added a comment - I'm not sure if it's fixed The exception is thrown due to a null Job's configuration and I haven't found a reproducible conditions in which it's thrown
          Hide
          dankirkd Daniel Kirkdorffer added a comment -

          I get massive amounts of errors when using v0.1.3 with Jenkins 1.528:

          Mar 04, 2014 10:11:36 AM WARNING hudson.ExpressionFactory2$JexlExpression evaluate
          Caught exception evaluating: it.getVersion(job) in /builds/user/Daniel.Kirkdorffer/my-views/view/Maven%20Info/. Reason: java.lang.NullPointerException
          java.lang.NullPointerException
          at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.getDependencyFilter(DependenciesVersionColumn.java:121)
          at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.getVersions(DependenciesVersionColumn.java:131)
          at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.getVersion(DependenciesVersionColumn.java:125)

          Mar 04, 2014 10:11:36 AM WARNING hudson.ExpressionFactory2$JexlExpression evaluate
          Caught exception evaluating: it.isMultipleVersions(job) in /builds/user/Daniel.Kirkdorffer/my-views/view/Maven%20Info/. Reason: java.lang.NullPointerException
          java.lang.NullPointerException
          at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.getDependencyFilter(DependenciesVersionColumn.java:121)
          at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.getVersions(DependenciesVersionColumn.java:131)
          at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.isMultipleVersions(DependenciesVersionColumn.java:140)

          Show
          dankirkd Daniel Kirkdorffer added a comment - I get massive amounts of errors when using v0.1.3 with Jenkins 1.528: Mar 04, 2014 10:11:36 AM WARNING hudson.ExpressionFactory2$JexlExpression evaluate Caught exception evaluating: it.getVersion(job) in /builds/user/Daniel.Kirkdorffer/my-views/view/Maven%20Info/. Reason: java.lang.NullPointerException java.lang.NullPointerException at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.getDependencyFilter(DependenciesVersionColumn.java:121) at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.getVersions(DependenciesVersionColumn.java:131) at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.getVersion(DependenciesVersionColumn.java:125) Mar 04, 2014 10:11:36 AM WARNING hudson.ExpressionFactory2$JexlExpression evaluate Caught exception evaluating: it.isMultipleVersions(job) in /builds/user/Daniel.Kirkdorffer/my-views/view/Maven%20Info/. Reason: java.lang.NullPointerException java.lang.NullPointerException at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.getDependencyFilter(DependenciesVersionColumn.java:121) at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.getVersions(DependenciesVersionColumn.java:131) at jenkins.plugins.maveninfo.columns.DependenciesVersionColumn.isMultipleVersions(DependenciesVersionColumn.java:140)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Emilio Jose Mena Cebrian
          Path:
          src/main/java/jenkins/plugins/maveninfo/columns/DependenciesVersionColumn.java
          src/main/java/jenkins/plugins/maveninfo/columns/LastVersionColumn.java
          src/main/java/jenkins/plugins/maveninfo/util/BuildUtils.java
          http://jenkins-ci.org/commit/maven-info-plugin/06f4de95324268c5cd9b3b5e15d505b3bdbac623
          Log:
          JENKINS-21450

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Emilio Jose Mena Cebrian Path: src/main/java/jenkins/plugins/maveninfo/columns/DependenciesVersionColumn.java src/main/java/jenkins/plugins/maveninfo/columns/LastVersionColumn.java src/main/java/jenkins/plugins/maveninfo/util/BuildUtils.java http://jenkins-ci.org/commit/maven-info-plugin/06f4de95324268c5cd9b3b5e15d505b3bdbac623 Log: JENKINS-21450
          Hide
          dankirkd Daniel Kirkdorffer added a comment -

          Just to confirm the new version, 0.2.0, fixes the problems I was seeing. Thanks.

          Show
          dankirkd Daniel Kirkdorffer added a comment - Just to confirm the new version, 0.2.0, fixes the problems I was seeing. Thanks.

            People

            • Assignee:
              emenaceb Emilio Jose Mena Cebrian
              Reporter:
              marelooke Bert Geens
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: