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

Going to a JAX-RS resource that contains a space in the path returns a 404 response code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.1
    • 2.3.2, 2.4
    • None
    • None
    • Java 1.6_22
      Apache CXF 2.3.1

    • Novice

    Description

      If you go to a JAX-RS resource that contains a space in the path, the Apache CXF JAX-RS runtime returns a 404 response code. In the STDERR log, you'll see the following message:

      Jan 1, 2011 3:05:01 PM org.apache.cxf.jaxrs.utils.JAXRSUtils findTargetMethod
      WARNING: .No operation matching request path /has%20space is found, HTTP Method : GET, ContentType : /, Accept : application/xml,application/xhtml+xml,image/png,text/html;q=0.9,text/plain;q=0.8,/;q=0.5,.

      The cause for this problem may be found in AbstractServerController.getBaseURL. It assumes pathInfo is always decoded but in the JAX-RS situation, it may actually still be encoded.

      Relevant sample code + patch attached.

      Attachments

        1. cxf_jax_rs_space_bug.zip
          2 kB
          Jason Downey
        2. patch.diff
          1 kB
          Jason Downey

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            jadowney Jason Downey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: