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

NullPointerExcpetion when try to slice parameters

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If I try to "slice" parameters for my projects I get a empty page. After taking a look into the log files I see the following stack trace:

      INFO: Loaded: class configurationslicing.tools.GroovySlicer
      Dec 09, 2014 9:08:27 AM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: it.configuredValues in /jenkins/slicing/parameters/. Reason: java.lang.reflect.InvocationTargetException
      java.lang.reflect.InvocationTargetException
      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.PropertyExecutor.execute(PropertyExecutor.java:125)
      at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314)
      at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
      at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
      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.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:61)
      at org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsIterator(ExpressionSupport.java:94)
      at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:89)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      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.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
      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.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
      at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
      at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
      at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
      at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
      at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      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.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
      at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
      at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
      at org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:112)
      at org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:127)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:735)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:391)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:391)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
      at com.cloudbees.jenkins.support.slowrequest.SlowRequestFilter.doFilter(SlowRequestFilter.java:37)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
      at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198)
      at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176)
      at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:85)
      at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:99)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
      at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:117)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
      at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:58)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.jenkinsci.plugins.reverse_proxy_auth.ReverseProxySecurityRealm$1.doFilter(ReverseProxySecurityRealm.java:454)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:197)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
      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: java.lang.NullPointerException

        Attachments

          Activity

          Hide
          waffel Thomas Wabner added a comment -

          Found one missed piece in the log:
          Caused by: java.lang.NullPointerException
          at java.lang.String$CaseInsensitiveComparator.compare(String.java:1177)
          at java.lang.String$CaseInsensitiveComparator.compare(String.java:1170)
          at java.util.TimSort.countRunAndMakeAscending(TimSort.java:324)
          at java.util.TimSort.sort(TimSort.java:189)
          at java.util.TimSort.sort(TimSort.java:173)
          at java.util.Arrays.sort(Arrays.java:659)
          at java.util.Collections.sort(Collections.java:217)
          at configurationslicing.UnorderedStringSlice.getConfiguredValues(UnorderedStringSlice.java:110)
          ... 130 more

          Show
          waffel Thomas Wabner added a comment - Found one missed piece in the log: Caused by: java.lang.NullPointerException at java.lang.String$CaseInsensitiveComparator.compare(String.java:1177) at java.lang.String$CaseInsensitiveComparator.compare(String.java:1170) at java.util.TimSort.countRunAndMakeAscending(TimSort.java:324) at java.util.TimSort.sort(TimSort.java:189) at java.util.TimSort.sort(TimSort.java:173) at java.util.Arrays.sort(Arrays.java:659) at java.util.Collections.sort(Collections.java:217) at configurationslicing.UnorderedStringSlice.getConfiguredValues(UnorderedStringSlice.java:110) ... 130 more
          Hide
          waffel Thomas Wabner added a comment -

          I have found the root cause of this error:

          I have a project with a parameter definition like this:

           <hudson.model.StringParameterDefinition>
            <name>deployment_reason</name>  
           </hudson.model.StringParameterDefinition>
          

          It is missing the <description> and <defaultValue> tags. It should look like this

           <hudson.model.StringParameterDefinition>
            <name>deployment_reason</name> 
            <description /> 
            <defaultValue /> 
           </hudson.model.StringParameterDefinition>
          

          I have changed the code in UnorderedStringSlice for the method addLineWithSets to following:

          private static void addLineWithSets(Map<String, Set<String>> map, String s, String name) {
          			  if (null == s) {
          					LOGGER.severe("found illegal line with null value for name: "+name);
          					// do nothing
          					return;
          				}
                  if(!map.containsKey(s)) {
                      map.put(s, new HashSet<String>());
                  }
                  Set<String> list= map.get(s);
                  list.add(name);
              }
          
          Show
          waffel Thomas Wabner added a comment - I have found the root cause of this error: I have a project with a parameter definition like this: <hudson.model.StringParameterDefinition> <name> deployment_reason </name> </hudson.model.StringParameterDefinition> It is missing the <description> and <defaultValue> tags. It should look like this <hudson.model.StringParameterDefinition> <name> deployment_reason </name> <description /> <defaultValue /> </hudson.model.StringParameterDefinition> I have changed the code in UnorderedStringSlice for the method addLineWithSets to following: private static void addLineWithSets(Map< String , Set< String >> map, String s, String name) { if ( null == s) { LOGGER.severe( "found illegal line with null value for name: " +name); // do nothing return ; } if (!map.containsKey(s)) { map.put(s, new HashSet< String >()); } Set< String > list= map.get(s); list.add(name); }
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ninian
          Path:
          src/main/java/configurationslicing/UnorderedStringSlice.java
          http://jenkins-ci.org/commit/configurationslicing-plugin/2523774125cc54319bf4c6ed5ddd888b282f4837
          Log:
          Applying suggested fix for JENKINS-25964

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ninian Path: src/main/java/configurationslicing/UnorderedStringSlice.java http://jenkins-ci.org/commit/configurationslicing-plugin/2523774125cc54319bf4c6ed5ddd888b282f4837 Log: Applying suggested fix for JENKINS-25964
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ninian
          Path:
          src/main/java/configurationslicing/UnorderedStringSlice.java
          http://jenkins-ci.org/commit/configurationslicing-plugin/5ef829b9f18300068be6c6d54f3f0804885ef8f2
          Log:
          [FIXED JENKINS-25964]

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ninian Path: src/main/java/configurationslicing/UnorderedStringSlice.java http://jenkins-ci.org/commit/configurationslicing-plugin/5ef829b9f18300068be6c6d54f3f0804885ef8f2 Log: [FIXED JENKINS-25964]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ninian
          Path:
          src/main/java/configurationslicing/UnorderedStringSlice.java
          http://jenkins-ci.org/commit/configurationslicing-plugin/0aadd9ec613ed84e4a379088e31bee30421038d8
          Log:
          Merge pull request #16 from ninian/master

          Applying suggested fix for JENKINS-25964

          Compare: https://github.com/jenkinsci/configurationslicing-plugin/compare/e454609618fb...0aadd9ec613e

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ninian Path: src/main/java/configurationslicing/UnorderedStringSlice.java http://jenkins-ci.org/commit/configurationslicing-plugin/0aadd9ec613ed84e4a379088e31bee30421038d8 Log: Merge pull request #16 from ninian/master Applying suggested fix for JENKINS-25964 Compare: https://github.com/jenkinsci/configurationslicing-plugin/compare/e454609618fb...0aadd9ec613e

            People

            • Assignee:
              mdonohue mdonohue
              Reporter:
              waffel Thomas Wabner
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: