Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-14157

Queueing build via REST API does not work with json content type

    XMLWordPrintable

Details

    Description

      According to this documentation on the REST API: https://developer.atlassian.com/static/rest/bamboo/3.3-SNAPSHOT.html#idp28800 , queuing a build should accept the following content types:

      1. application/xml
      2. application/x-www-form-urlencoded
      3. application/json

      The above two works but fails on the json content type. This causes hooks like the JIRA webhook to fail to trigger a build in Bamboo as by default, it sens outs events in json

      I have tried to test this using the URL below:

      curl -u admin:admin -X POST -H "Content-Type: application/json" http://10.60.2.181:10520/bamboo52/rest/api/latest/queue/TESTA-TSTA
      

      This fails with the error:

      java.io.EOFException: No content to map to Object due to end of input
      	at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2766)
      	at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2682)
      	at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1308)
      	at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419)
      	at com.sun.jersey.spi.container.ContainerRequest.getEntity(ContainerRequest.java:474)
      	at com.sun.jersey.spi.container.ContainerRequest.getEntity(ContainerRequest.java:538)
      	at com.sun.jersey.server.impl.model.method.dispatch.FormDispatchProvider.processForm(FormDispatchProvider.java:103)
      	at com.sun.jersey.server.impl.model.method.dispatch.FormDispatchProvider.access$000(FormDispatchProvider.java:68)
      	at com.sun.jersey.server.impl.model.method.dispatch.FormDispatchProvider$FormParameterProvider.getInjectableValues(FormDispatchProvider.java:115)
      	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$EntityParamInInvoker.getParams(AbstractResourceMethodDispatchProvider.java:153)
      	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:183)
      	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
      	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
      	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
      	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
      	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
      

      Attachments

        Issue Links

          Activity

            People

              pskierczynski Pawel Skierczynski
              smaiyaki Sultan Maiyaki (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: