Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8097

Equal candidates for handling the current request (HEAD / GET)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.2, 3.3.3, 3.3.4
    • 3.3.5, 3.2.12, 3.4.0
    • JAX-RS
    • None
    • Unknown

    Description

      I have just migrated a very outdated Spring backend to Spring 5 and with it upgraded CXF to first 3.3.2 and just now 3.3.3. I have a REST service class defining two different methods with the same path defined via javax.ws.rs.Path annotation, differentiated by javax.ws.rs.HEAD and javax.ws.rs.GET annotations. Both methods are annotated with @Produces(MediaType.APPLICATION_OCTET_STREAM).

      When this method is called I get (redacted):

      WARN [JAXRSUtils.compare:129] Both ServiceRestImpl#getFile and ServiceRestImpl#getFileAsHeadRequest are equal candidates for handling the current request which can lead to unpredictable results

      The differentiation works: HEAD requests are handled by the @HEAD annotated method and GET requests by the @GET annotated one (this has always worked). Therefore the warning is false but will severely clutter production log output, possibly affect performance.

      Relevant dependencies:

      • Spring framework 5.1.8
      • "org.apache.cxf", "cxf-rt-rs-service-description", "3.3.3"
      • "javax.servlet", "javax.servlet-api", "4.0.1"
      • "javax.ws.rs", "javax.ws.rs-api", "2.0.1"

      I'd appreciate support. May be linked to:

      Attachments

        1. Screenshot 2019-12-17 at 08.44.29.png
          40 kB
          Carsten D
        2. cxf-8097-mcve.zip
          14.60 MB
          Carsten D

        Activity

          People

            reta Andriy Redko
            carsten.d Carsten D
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: