jersey
  1. jersey
  2. JERSEY-1636

InternalServerError for an unspecified MIME type in request

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 2.0-rc1, 2.0
    • Component/s: None
    • Labels:
      None

      Description

      For a resource definition as:

      @GET
      @Produces(

      {"application/json", "application/xml"}

      )
      @Path("

      {id}")
      public Person getPerson(@PathParam("id")String id) { return new Person("Name" + id, Integer.valueOf(id)); }

      A client request like:

      Person person = target
      .path("{id}

      ")
      .resolveTemplate("id", "1")
      .request(MediaType.APPLICATION_XML)
      .get(Person.class);

      works fine.

      But

      Person person = target
      .path("

      {id}

      ")
      .resolveTemplate("id", "1")
      .request()
      .get(Person.class);

      throws

      javax.ws.rs.InternalServerErrorException
      at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:865)
      at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:728)
      at org.glassfish.jersey.client.JerseyInvocation.access$500(JerseyInvocation.java:86)
      at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:629)
      at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:420)
      at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:625)
      at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:360)
      at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:260)

        Activity

        Hide
        Michal Gajdos added a comment -

        I am not able to reproduce this issue (using Jersey 2.0-m13-3). Can you confirm?

        Show
        Michal Gajdos added a comment - I am not able to reproduce this issue (using Jersey 2.0-m13-3). Can you confirm?

          People

          • Assignee:
            Michal Gajdos
            Reporter:
            arungupta
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 3 hours
              3h
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 30 minutes Time Not Required
              30m