Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-1510

CXF Continuations not working for REST services

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.1
    • 7.0.0-M1
    • None
    • None

    Description

      CXF Continuations for asynchronous REST requests are not working. You can suspend the current request but when you try to resume it, the original method will not be found. I debugged into the code and the bug seems to be in line 118 of org.apache.tomee.webservices.TomcatRsRegistry. The URL mapping as added both to the mapping wrapper (line 117) and the context itself. In line 117 the context root is correctly removed but in line 118 it isn't. Therefore the context has a mapping of e.g. "/my.context/rest/" instead of the correct "/rest/".
      The problem does not become apparent on the intial request because there the URL mapping of the Connector is used to dispatch to the correct class and method and not the Context's mapping. The connector has the correct mapping (in addition to the wrong one), which was added by org.apache.catalina.connector.MapperListener.registerContext. However, when using continuations, only the context's mapping is consulted because it's an "internal" request. Due to the wrong mapping the "/" mapping is used in the end.
      The fixed would be simple, just remove the context in line 118, too. I cannot judge if this has any side-effects, though.

      Attachments

        1. org.example.continuations_tomcat.zip
          9 kB
          Thorsten Meinl
        2. org.example.continuations_tomee.zip
          9 kB
          Thorsten Meinl

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            thor Thorsten Meinl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: