jersey
  1. jersey
  2. JERSEY-1615

standard JAXBElementProvider does not work for appropriate mediaType

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Duplicate
    • Affects Version/s: 2.0-m10
    • Fix Version/s: 2.0-m11, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      Spec., section 4.2.4 Standard Entity Providers, says:

      javax.xml.bind.JAXBElement and application-supplied JAXB classes XML media types (text/xml, application/xml and application/*+xml).

      But for application/atom+xml:

      "POST /web/resource/jaxb HTTP/1.1[\r][\n]"
      "Content-Type: application/atom+xml[\r][\n]"
      "Accept: application/atom+xml[\r][\n]"
      "Content-Length: 15[\r][\n]"
      "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
      "Host: localhost:6080[\r][\n]"
      "[\r][\n]"

      the following response is given:

      "<tag>jaxb</tag>"
      "HTTP/1.1 415 Unsupported Media Type[\r][\n]"
      "HTTP/1.1 415 Unsupported Media Type[\r][\n]"
      "Server: Apache-Coyote/1.1[\r][\n]"
      "Content-Type: text/html;charset=utf-8[\r][\n]"
      "Content-Length: 1117[\r][\n]"
      "Date: Tue, 11 Dec 2012 17:40:53 GMT[\r][\n]"
      "[\r][\n]"

      on resource:

      @Path("resource")
      public class Resource {
      @Context HttpHeaders headers;
      	@Path("jaxb")	
      	@POST
      	public Response jaxb(JAXBElement<String> jaxb) {
      		MediaType media = headers.getMediaType();
      		return Response.ok(jaxb).type(media).build();
      	}	
      }
      

        Activity

        Hide
        jan.supol added a comment -

        Duplicates 1501

        Show
        jan.supol added a comment - Duplicates 1501

          People

          • Assignee:
            jan.supol
            Reporter:
            jan.supol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: