RequestMappingInfo.getMatchingCondition throwing IllegalArgumentException after upgrading to springboot 2.4.13

Solution 1:

Got a workaround for this from SpringFramework issues.

However, I was using the older mechanism of path/request matching in RequestMappingInfo and was using RequestMappingHandlerMapping in Filter specifically OncePerRequestFilter. Certain attributes like PATH are set later in the code hence the error. Though as per community thread it is bad practise to use RequestMappingHandlerMapping (the way I have above)inside OncePerRequestFilter calling below code explicitly resolved the issue for me,

requestMappingHandlerMapping.getUrlPathHelper().resolveAndCacheLookupPath(request);