jersey
  1. jersey
  2. JERSEY-1116

Two resource methods with @Produces "*/*" and "text/plain" makes the deployment fail

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-m04
    • Fix Version/s: 2.0-m05, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      When having the resource

      @Path("resource/subresource/sub")
      public class AnotherSubResource {
      
      	@POST
      	public String sub() {
      		return getClass().getSimpleName();
      	}
      
      	@POST
      	@Consumes(MediaType.TEXT_PLAIN)
      	public String subsub() {
      		return sub() + sub();
      	}
      
      	@GET
      	public String get() {
      		return sub();
      	}
      
      	@GET
      	@Produces(MediaType.TEXT_PLAIN)
      	public String getget() {
      		return subsub();
      	}
      }
      

      the deployment fails, Jersey says:

      SEVERE: The following errors and warnings have been detected with resource classes:
      ERROR: A resource, com.sun.ts.tests.jaxrs.spec.resource.requestmatching.AnotherSubResource, has ambiguous (sub-)resource method for HTTP method GET and output mime-types as defined by @Produces annotation at Java methods public java.lang.String com.sun.ts.tests.jaxrs.spec.resource.requestmatching.AnotherSubResource.get() and public java.lang.String com.sun.ts.tests.jaxrs.spec.resource.requestmatching.AnotherSubResource.getget().

        Activity

        Hide
        Pavel Bucek added a comment -

        generate warning instead of deployment error

        Show
        Pavel Bucek added a comment - generate warning instead of deployment error
        Hide
        Miroslav Fuksa added a comment -

        merged to the master branch

        Show
        Miroslav Fuksa added a comment - merged to the master branch

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 9 hours Original Estimate - 9 hours
              9h
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 22 hours
              22h