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

bindJSON has problems with arrays of length 1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • other
    • None
    • Platform: All, OS: All

      When I have a form with a repeatable and there is only one entry, Stapler cannot
      seem to understand how to construct the object.

      This works fine with 0 rows, or more than 1 row. only fails for 1 row.

      As an example, see the javancss plugin currently in CVS

      HTTP ERROR: 500

      Unable to find [Lhudson/plugins/javancss/JavaNCSSHealthTarget;.stapler. Have you
      put @stapler-constructor javadoc tag on a constructor?

      RequestURI=/job/simple-ant/configSubmit
      Caused by:

      org.kohsuke.stapler.NoStaplerConstructorException: Unable to find
      [Lhudson/plugins/javancss/JavaNCSSHealthTarget;.stapler. Have you put
      @stapler-constructor javadoc tag on a constructor?
      at org.kohsuke.stapler.RequestImpl.loadConstructorParamNames(RequestImpl.java:388)
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:273)
      at org.kohsuke.stapler.RequestImpl.convertJSON(RequestImpl.java:322)
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:285)
      at
      hudson.plugins.javancss.JavaNCSSPublisher$DescriptorImpl.newInstance(JavaNCSSPublisher.java:89)
      at
      hudson.plugins.javancss.JavaNCSSPublisher$DescriptorImpl.newInstance(JavaNCSSPublisher.java:71)
      at hudson.model.AbstractProject.buildDescribable(AbstractProject.java:888)
      at hudson.model.Project.submit(Project.java:151)
      at hudson.model.Job.doConfigSubmit(Job.java:723)
      at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:292)
      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:103)
      at org.kohsuke.stapler.Function.bindAndinvoke(Function.java:57)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:69)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:365)
      at org.kohsuke.stapler.MetaClass$9.doDispatch(MetaClass.java:248)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:365)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:301)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:98)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
      at
      org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:88)
      at
      org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
      at
      org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
      at org.mortbay.jetty.Server.handle(Server.java:285)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

      Powered by Jetty://

            kohsuke Kohsuke Kawaguchi
            stephenconnolly Stephen Connolly
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: