This wouldn't happen on Jenkins 1.498:

      Exception: java.lang.NullPointerException
      Stacktrace:
      javax.servlet.ServletException: java.lang.NullPointerException
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:615)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:658)
      	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
      	...
      Caused by: java.lang.NullPointerException
      	at java.util.Vector.addAll(Unknown Source)
      	at hudson.model.AbstractProject.getActions(AbstractProject.java:1110)
      	at hudson.model.Actionable.getActions(Actionable.java:88)
      	at hudson.plugins.jobConfigHistory.JobConfigHistoryActionFactory.createFor(JobConfigHistoryActionFactory.java:30)
      	at hudson.model.AbstractProject.createTransientActions(AbstractProject.java:698)
      	at hudson.maven.AbstractMavenProject.createTransientActions(AbstractMavenProject.java:177)
      	at hudson.maven.MavenModuleSet.createTransientActions(MavenModuleSet.java:448)
      	at hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:688)
      	at hudson.maven.MavenModuleSet.updateTransientActions(MavenModuleSet.java:444)
      	at hudson.model.AbstractProject.save(AbstractProject.java:266)
      	at hudson.model.Job.onLoad(Job.java:192)
      	at hudson.model.AbstractProject.onLoad(AbstractProject.java:278)
      	at hudson.maven.MavenModuleSet.onLoad(MavenModuleSet.java:746)
      	at hudson.model.Items.load(Items.java:221)
      	at hudson.model.ItemGroupMixIn.copy(ItemGroupMixIn.java:208)
      	at hudson.model.ItemGroupMixIn.createTopLevelItem(ItemGroupMixIn.java:164)
      	at jenkins.model.Jenkins.doCreateItem(Jenkins.java:2857)
      	at jenkins.model.Jenkins.doCreateItem(Jenkins.java:308)
      	at hudson.model.ListView.doCreateItem(ListView.java:208)
      	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.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:573)
      	... 62 more
      

          [JENKINS-16499] NPE when new job by copy from existing one

          This problem happens on a clean 1.500 install too, steps to produce:

          1. Start the clean Jenkins installation
          2. New maven project, named "test", OK and then OK
          3. New job named "npe", select copy existing Job from "test"

          Pei-Tang Huang added a comment - This problem happens on a clean 1.500 install too, steps to produce: Start the clean Jenkins installation New maven project, named "test", OK and then OK New job named "npe", select copy existing Job from "test"

          Which version of the jobconfighistory plugin do you use in your jenkins?

          Stefan Brausch added a comment - Which version of the jobconfighistory plugin do you use in your jenkins?

          Dirk Kuypers added a comment -

          I have the same issue since upgrading to 1.500 and I am using version 2.1.1 of the jobconfighistory plugin.

          Dirk Kuypers added a comment - I have the same issue since upgrading to 1.500 and I am using version 2.1.1 of the jobconfighistory plugin.

          @stefanbrausch: I think the version of JobConfigHistory is irrelevant. You can try the steps in the first comment to test if you can reproduce this problem without any plugins installed.

          Pei-Tang Huang added a comment - @stefanbrausch: I think the version of JobConfigHistory is irrelevant. You can try the steps in the first comment to test if you can reproduce this problem without any plugins installed.

          I can confirm this.

          We have a lot of complicated and quite similar jobs, so we always create new jobs based on old jobs making this issue critical to us. Please let me know if anybody finds a temporary workaround.

          Thanks!

          David Langeland added a comment - I can confirm this. We have a lot of complicated and quite similar jobs, so we always create new jobs based on old jobs making this issue critical to us. Please let me know if anybody finds a temporary workaround. Thanks!

          epikur2412 added a comment -

          I tried to upload three jobs via https. The result was a return code 500 for the first job.
          Then I retried the upload for the same jobs. Now, the first job was uploaded without an error, but the second job returns an error code 500.
          And so on.

          epikur2412 added a comment - I tried to upload three jobs via https. The result was a return code 500 for the first job. Then I retried the upload for the same jobs. Now, the first job was uploaded without an error, but the second job returns an error code 500. And so on.

          Yordan Boev added a comment - - edited

          The NPE is a result of AbstractProject.getActions() calling the java.unil.Vector.addAll() method with a null parameter.
          It comes from a method implemented in the Jenkins Core:

              public synchronized List<Action> getActions() {
                  // add all the transient actions, too
                  List<Action> actions = new Vector<Action>(super.getActions());
           NPE => actions.addAll(transientActions); 
                  // return the read only list to cause a failure on plugins who try to add an action here
                  return Collections.unmodifiableList(actions);
              }
              

          maybe there should be a check if transientActions is not null.

          The problem also exists in other plugins using the Abstractproject.getActions() method in their ActionFactory classes, for example JobConfighistory and JSWidgets.
          We could catch the exception and treat it as if there were no actions for the current project (see code below). That would solve the problem, but maybe it would be better if the method getAction() in AbstractProject is changed to return null or and empty list if there are no actions for a certain project.

          Workaround:
          Old code of JobConfigHistoryActionFactory.createFor(AbstractProject project)(with NPE)

              public Collection<? extends Action> createFor(@SuppressWarnings("unchecked") AbstractProject target) {
                  final ArrayList<Action> actions = new ArrayList<Action>();
                  final List<JobConfigHistoryProjectAction> historyJobActions = target.getActions(JobConfigHistoryProjectAction.class);
                  LOG.fine(target + " already had " + historyJobActions);
                  final JobConfigHistoryProjectAction newAction = new JobConfigHistoryProjectAction(target);
                  actions.add(newAction);
                  LOG.fine(this + " adds " + newAction + " for " + target);
                  return actions;
              }
          

          New code of JobConfigHistoryActionFactory.createFor(AbstractProject project)(catching the NPE)

              public Collection<? extends Action> createFor(@SuppressWarnings("rawtypes") AbstractProject target) {
                  List<JobConfigHistoryProjectAction> historyJobActions;
                  try {
                      historyJobActions = target.getActions(JobConfigHistoryProjectAction.class);
                  } catch (NullPointerException e) {
                      historyJobActions = null;
                  }
          
                  if (historyJobActions != null && !historyJobActions.isEmpty()) {
                      return historyJobActions;
                  }
                  final ArrayList<Action> actions = new ArrayList<Action>();
                  final JobConfigHistoryProjectAction newAction = new JobConfigHistoryProjectAction(target);
                  actions.add(newAction);
                  return actions;
              }
          

          Yordan Boev added a comment - - edited The NPE is a result of AbstractProject.getActions() calling the java.unil.Vector.addAll() method with a null parameter. It comes from a method implemented in the Jenkins Core: public synchronized List<Action> getActions() { // add all the transient actions, too List<Action> actions = new Vector<Action>( super .getActions()); NPE => actions.addAll(transientActions); // return the read only list to cause a failure on plugins who try to add an action here return Collections.unmodifiableList(actions); } maybe there should be a check if transientActions is not null. The problem also exists in other plugins using the Abstractproject.getActions() method in their ActionFactory classes, for example JobConfighistory and JSWidgets. We could catch the exception and treat it as if there were no actions for the current project (see code below). That would solve the problem, but maybe it would be better if the method getAction() in AbstractProject is changed to return null or and empty list if there are no actions for a certain project. Workaround: Old code of JobConfigHistoryActionFactory.createFor(AbstractProject project)(with NPE) public Collection<? extends Action> createFor(@SuppressWarnings( "unchecked" ) AbstractProject target) { final ArrayList<Action> actions = new ArrayList<Action>(); final List<JobConfigHistoryProjectAction> historyJobActions = target.getActions(JobConfigHistoryProjectAction.class); LOG.fine(target + " already had " + historyJobActions); final JobConfigHistoryProjectAction newAction = new JobConfigHistoryProjectAction(target); actions.add(newAction); LOG.fine( this + " adds " + newAction + " for " + target); return actions; } New code of JobConfigHistoryActionFactory.createFor(AbstractProject project)(catching the NPE) public Collection<? extends Action> createFor(@SuppressWarnings( "rawtypes" ) AbstractProject target) { List<JobConfigHistoryProjectAction> historyJobActions; try { historyJobActions = target.getActions(JobConfigHistoryProjectAction.class); } catch (NullPointerException e) { historyJobActions = null ; } if (historyJobActions != null && !historyJobActions.isEmpty()) { return historyJobActions; } final ArrayList<Action> actions = new ArrayList<Action>(); final JobConfigHistoryProjectAction newAction = new JobConfigHistoryProjectAction(target); actions.add(newAction); return actions; }

          Code changed in jenkins
          User: kstutz
          Path:
          src/main/java/hudson/plugins/jobConfigHistory/JobConfigHistoryActionFactory.java
          src/test/java/hudson/plugins/jobConfigHistory/JobConfigHistoryJobListenerTest.java
          http://jenkins-ci.org/commit/jobConfigHistory-plugin/5739007a07ce8f1f3ef111652450f7af045bc686
          Log:
          Workaround for JENKINS-16499


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: kstutz Path: src/main/java/hudson/plugins/jobConfigHistory/JobConfigHistoryActionFactory.java src/test/java/hudson/plugins/jobConfigHistory/JobConfigHistoryJobListenerTest.java http://jenkins-ci.org/commit/jobConfigHistory-plugin/5739007a07ce8f1f3ef111652450f7af045bc686 Log: Workaround for JENKINS-16499 – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          Kathi Stutz added a comment -

          Using Yordan's code, I released a workaround for the JobConfigHistory plugin today. It catches the NPE, which is still thrown by the core.

          Kathi Stutz added a comment - Using Yordan's code, I released a workaround for the JobConfigHistory plugin today. It catches the NPE, which is still thrown by the core.

          Hi Kathi,

          Do you know when you will release version 2.2 of JobConfigHistory? Based in https://wiki.jenkins-ci.org/display/JENKINS/JobConfigHistory+Plugin it seems like it should already be released?

          Thanks!

          David Langeland added a comment - Hi Kathi, Do you know when you will release version 2.2 of JobConfigHistory? Based in https://wiki.jenkins-ci.org/display/JENKINS/JobConfigHistory+Plugin it seems like it should already be released? Thanks!

          Kathi Stutz added a comment -

          Hi David,
          Version 2.2 was released yesterday. The plugin information on the Jenkins wiki page always takes a while until it is up-to-date, but the new version should also appear in the update centre of your Jenkins instance.

          Kathi Stutz added a comment - Hi David, Version 2.2 was released yesterday. The plugin information on the Jenkins wiki page always takes a while until it is up-to-date, but the new version should also appear in the update centre of your Jenkins instance.

          Strange I have checked several times, but it just appeared now. Thanks a lot

          David Langeland added a comment - Strange I have checked several times, but it just appeared now. Thanks a lot

          Shouldn't it be resolved in the Jenkins core?
          Thus problem occurs in a clean Jenkins installation, which without JobConfigHistory installed, too. See first comment to reproduce this problem easily.

          Pei-Tang Huang added a comment - Shouldn't it be resolved in the Jenkins core? Thus problem occurs in a clean Jenkins installation, which without JobConfigHistory installed, too. See first comment to reproduce this problem easily.

          Kathi Stutz added a comment -

          Yes, it still has to be resolved in the core.
          But if you have the JobConfigHistory plugin installed, the NPE appears not only when trying to copy a maven project but also with freestyle projects, the latter being the fault of our plugin. So, our latest release just tries to improve the situation by at least solving the problems that are caused by JobConfigHistory.

          Kathi Stutz added a comment - Yes, it still has to be resolved in the core. But if you have the JobConfigHistory plugin installed, the NPE appears not only when trying to copy a maven project but also with freestyle projects, the latter being the fault of our plugin. So, our latest release just tries to improve the situation by at least solving the problems that are caused by JobConfigHistory.

          nickithewatt added a comment -

          I confirm that this appears to be a problem regardless of which plugins are installed. The core needs fixing.

          nickithewatt added a comment - I confirm that this appears to be a problem regardless of which plugins are installed. The core needs fixing.

          kutzi added a comment -

          Using the steps mentioned in the 1st comment results in a different stack trace, but still a NPE:

          javax.servlet.ServletException: java.lang.NullPointerException
          	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:615)
          	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:658)
          	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
          	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
          	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:573)
          	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:658)
          	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:487)
          	at org.kohsuke.stapler.Stapler.service(Stapler.java:164)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
          	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
          	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1367)
          	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
          	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
          	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338)
          	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
          	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338)
          	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
          	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
          	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
          	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338)
          	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50)
          	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338)
          	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
          	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338)
          	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
          	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
          	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499)
          	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
          	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
          	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
          	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
          	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
          	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
          	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
          	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
          	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
          	at org.eclipse.jetty.server.Server.handle(Server.java:350)
          	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
          	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:900)
          	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:954)
          	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:851)
          	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
          	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
          	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:620)
          	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
          	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
          	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
          	at java.lang.Thread.run(Thread.java:662)
          Caused by: java.lang.NullPointerException
          	at hudson.model.AbstractProject.getLastBuild(AbstractProject.java:1021)
          	at hudson.maven.AbstractMavenProject.createTransientActions(AbstractMavenProject.java:184)
          	at hudson.maven.MavenModuleSet.createTransientActions(MavenModuleSet.java:448)
          	at hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:688)
          	at hudson.maven.MavenModuleSet.updateTransientActions(MavenModuleSet.java:444)
          	at hudson.model.AbstractProject.save(AbstractProject.java:266)
          	at hudson.model.Job.onLoad(Job.java:192)
          	at hudson.model.AbstractProject.onLoad(AbstractProject.java:278)
          	at hudson.maven.MavenModuleSet.onLoad(MavenModuleSet.java:746)
          	at hudson.model.Items.load(Items.java:221)
          	at hudson.model.ItemGroupMixIn.copy(ItemGroupMixIn.java:208)
          	at hudson.model.ItemGroupMixIn.createTopLevelItem(ItemGroupMixIn.java:164)
          	at jenkins.model.Jenkins.doCreateItem(Jenkins.java:2857)
          	at jenkins.model.Jenkins.doCreateItem(Jenkins.java:304)
          	at hudson.model.AllView.doCreateItem(AllView.java:76)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          	at java.lang.reflect.Method.invoke(Method.java:597)
          	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)
          	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)
          	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90)
          	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)
          	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
          	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:573)
          	... 47 more
          

          kutzi added a comment - Using the steps mentioned in the 1st comment results in a different stack trace, but still a NPE: javax.servlet.ServletException: java.lang.NullPointerException at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:615) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:658) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:573) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:658) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:487) at org.kohsuke.stapler.Stapler.service(Stapler.java:164) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1367) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:499) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) at org.eclipse.jetty.server.Server.handle(Server.java:350) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:900) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:954) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:851) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:620) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) at java.lang. Thread .run( Thread .java:662) Caused by: java.lang.NullPointerException at hudson.model.AbstractProject.getLastBuild(AbstractProject.java:1021) at hudson.maven.AbstractMavenProject.createTransientActions(AbstractMavenProject.java:184) at hudson.maven.MavenModuleSet.createTransientActions(MavenModuleSet.java:448) at hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:688) at hudson.maven.MavenModuleSet.updateTransientActions(MavenModuleSet.java:444) at hudson.model.AbstractProject.save(AbstractProject.java:266) at hudson.model.Job.onLoad(Job.java:192) at hudson.model.AbstractProject.onLoad(AbstractProject.java:278) at hudson.maven.MavenModuleSet.onLoad(MavenModuleSet.java:746) at hudson.model.Items.load(Items.java:221) at hudson.model.ItemGroupMixIn.copy(ItemGroupMixIn.java:208) at hudson.model.ItemGroupMixIn.createTopLevelItem(ItemGroupMixIn.java:164) at jenkins.model.Jenkins.doCreateItem(Jenkins.java:2857) at jenkins.model.Jenkins.doCreateItem(Jenkins.java:304) at hudson.model.AllView.doCreateItem(AllView.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:573) ... 47 more

          kutzi added a comment -

          AbstractProject#onLoad calls super#onLoad which in turn calls AbstractProject#save which (in the maven case) tries to access the not-yet-initialized 'builds' RunMap.
          This pattern of doing stuff on incompletely initialized objects is IMO highly fragile and bound to create all sort of problems.
          However, I've got no clue how to fix that now, so assigning to Kohsuke.

          kutzi added a comment - AbstractProject#onLoad calls super#onLoad which in turn calls AbstractProject#save which (in the maven case) tries to access the not-yet-initialized 'builds' RunMap. This pattern of doing stuff on incompletely initialized objects is IMO highly fragile and bound to create all sort of problems. However, I've got no clue how to fix that now, so assigning to Kohsuke.

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          test/src/test/java/hudson/maven/MavenProjectTest.java
          http://jenkins-ci.org/commit/jenkins/7d422e60d9b3b2c678e6baf066e0780a29b027aa
          Log:
          Added testcase for JENKINS-16499


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: test/src/test/java/hudson/maven/MavenProjectTest.java http://jenkins-ci.org/commit/jenkins/7d422e60d9b3b2c678e6baf066e0780a29b027aa Log: Added testcase for JENKINS-16499 – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2237
          Added testcase for JENKINS-16499 (Revision 7d422e60d9b3b2c678e6baf066e0780a29b027aa)

          Result = UNSTABLE
          Christoph Kutzinski : 7d422e60d9b3b2c678e6baf066e0780a29b027aa
          Files :

          • test/src/test/java/hudson/maven/MavenProjectTest.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2237 Added testcase for JENKINS-16499 (Revision 7d422e60d9b3b2c678e6baf066e0780a29b027aa) Result = UNSTABLE Christoph Kutzinski : 7d422e60d9b3b2c678e6baf066e0780a29b027aa Files : test/src/test/java/hudson/maven/MavenProjectTest.java

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          core/src/main/java/hudson/model/Job.java
          http://jenkins-ci.org/commit/jenkins/12efbc3a9bbcd613dc1e4391283b6839cc79990a
          Log:
          [FIXED JENKINS-16499] Assuming that:

          • save() is not strictly necessary here. config.xml might be saved later or not - doesn't really matter
          • this else branch should only be entered when migrating from very old Hudson instances

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: core/src/main/java/hudson/model/Job.java http://jenkins-ci.org/commit/jenkins/12efbc3a9bbcd613dc1e4391283b6839cc79990a Log: [FIXED JENKINS-16499] Assuming that: save() is not strictly necessary here. config.xml might be saved later or not - doesn't really matter this else branch should only be entered when migrating from very old Hudson instances

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          test/src/test/java/hudson/maven/MavenProjectTest.java
          http://jenkins-ci.org/commit/jenkins/432c63d9851cadb7e93a110a9a22716b0e033d87
          Log:
          Changelog and fixed test for JENKINS-16499

          Compare: https://github.com/jenkinsci/jenkins/compare/7d422e60d9b3...432c63d9851c


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html test/src/test/java/hudson/maven/MavenProjectTest.java http://jenkins-ci.org/commit/jenkins/432c63d9851cadb7e93a110a9a22716b0e033d87 Log: Changelog and fixed test for JENKINS-16499 Compare: https://github.com/jenkinsci/jenkins/compare/7d422e60d9b3...432c63d9851c – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          kutzi added a comment -

          Found now a simple fix for it.
          However Kohsuke might still have a look on it, as I'm not 101% sure that this won't cause any regression.
          Also you might want to find out, why this else-branch in Job#onLoad is entered after all. According to the comment that should only happen when migrating old instances. However, it looks like the nextBuildNumber file is not created directly after creating a job. Maybe that should be fixed as the root cause.

          kutzi added a comment - Found now a simple fix for it. However Kohsuke might still have a look on it, as I'm not 101% sure that this won't cause any regression. Also you might want to find out, why this else-branch in Job#onLoad is entered after all. According to the comment that should only happen when migrating old instances. However, it looks like the nextBuildNumber file is not created directly after creating a job. Maybe that should be fixed as the root cause.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2238
          [FIXED JENKINS-16499] Assuming that: (Revision 12efbc3a9bbcd613dc1e4391283b6839cc79990a)
          Changelog and fixed test for JENKINS-16499 (Revision 432c63d9851cadb7e93a110a9a22716b0e033d87)

          Result = SUCCESS
          Christoph Kutzinski : 12efbc3a9bbcd613dc1e4391283b6839cc79990a
          Files :

          • core/src/main/java/hudson/model/Job.java

          Christoph Kutzinski : 432c63d9851cadb7e93a110a9a22716b0e033d87
          Files :

          • test/src/test/java/hudson/maven/MavenProjectTest.java
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #2238 [FIXED JENKINS-16499] Assuming that: (Revision 12efbc3a9bbcd613dc1e4391283b6839cc79990a) Changelog and fixed test for JENKINS-16499 (Revision 432c63d9851cadb7e93a110a9a22716b0e033d87) Result = SUCCESS Christoph Kutzinski : 12efbc3a9bbcd613dc1e4391283b6839cc79990a Files : core/src/main/java/hudson/model/Job.java Christoph Kutzinski : 432c63d9851cadb7e93a110a9a22716b0e033d87 Files : test/src/test/java/hudson/maven/MavenProjectTest.java changelog.html

          Vlad Beffa added a comment -

          Is it possible to download a jenkins.war from somewhere with this fix? Thanks.

          Vlad Beffa added a comment - Is it possible to download a jenkins.war from somewhere with this fix? Thanks.

          Arnaud Héritier added a comment - @vlad here : https://ci.jenkins-ci.org/job/jenkins_main_trunk/2238/

          when it will be available in latest release?

          Ireneusz Makowski added a comment - when it will be available in latest release?

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          test/src/test/java/hudson/maven/MavenProjectTest.java
          http://jenkins-ci.org/commit/maven-plugin/4c5f1936ac0e288a9f6534ec609b9927f8ab2a29
          Log:
          Added testcase for JENKINS-16499

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: test/src/test/java/hudson/maven/MavenProjectTest.java http://jenkins-ci.org/commit/maven-plugin/4c5f1936ac0e288a9f6534ec609b9927f8ab2a29 Log: Added testcase for JENKINS-16499

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          test/src/test/java/hudson/maven/MavenProjectTest.java
          http://jenkins-ci.org/commit/maven-plugin/314ccfde1b3b7cbcb0eb576ac2e8190776eb1fa3
          Log:
          Changelog and fixed test for JENKINS-16499

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: test/src/test/java/hudson/maven/MavenProjectTest.java http://jenkins-ci.org/commit/maven-plugin/314ccfde1b3b7cbcb0eb576ac2e8190776eb1fa3 Log: Changelog and fixed test for JENKINS-16499

            kohsuke Kohsuke Kawaguchi
            tang Pei-Tang Huang
            Votes:
            17 Vote for this issue
            Watchers:
            37 Start watching this issue

              Created:
              Updated:
              Resolved: