Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2266

Resources accessed under second ApplicationPath returns 404


    • Hide
      Clone sample app present under resteasy-spring-boot Start the spring-boot application. Hit POST endpoint, http://localhost:8080/sample-app/echo . Works as expected. Hit second POST endpoint, http://localhost:8080/second-app/echo . Y*ou get response status as 404*

      If there are two `ApplicationPath` registered in an application, resources accessed under second path would return 404 from RestEasy 4.0.0.Final. In RestEasy 3.7.0.Final, it is working.

      Sample app for testing

      RestEasy 3.7.0.Final

      RestEasy 4.0.0.Final

      This is happening due to wrong value returned for servletMappingPrefix here

      I suspect that the way context pushed using RestEasyContext and fetched when asked from SmallRyeConfig might returning stale data from threadlocals(RestEasyContext).

      ServletContextConfigSource.java#L56 returns previous ServletContext and ends returning the pre-fix value of '/sample-app/' rather than '/second-app/' during registration of second ApplicationPath value. Please see the attached screenshot.

      Also, underlying way of fetching prefix changed between 3.x and 4.x.
      `bootstrap.getParameter(ResteasyContextParameters.RESTEASY_SERVLET_MAPPING_PREFIX);` changed between 3.7.0 and 4.0.0. Not sure how much this is relevant though.

            weli@redhat.com Weinan Li
            cherryhitech Sharath Srinivasa (Inactive)
            1 Vote for this issue
            3 Start watching this issue