-
Bug
-
Resolution: Done
-
Major
-
4.0.0.Final
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
https://github.com/sharathsrinivasa/resteasy-spring-boot/tree/multiple-applicationPath/sample-app
RestEasy 4.0.0.Final
https://github.com/sharathsrinivasa/resteasy-spring-boot/tree/upgrade-2-resteasy-4
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.