I have a piece of code as below,
final Entry<RequestMappingInfo, HandlerMethod> e = mappingHandler.getHandlerMethods()
.entrySet()
.stream()
.filter(entry -> entry.getKey().getMatchingCondition(request) != null)
.findFirst()
.orElse(null);
which is working fine in spring-boot version 2.3.8.RELEASE but if I upgrade it to 2.4.13 it throws an exception as below,
java.lang.IllegalArgumentException: Expected lookupPath in request attribute "org.springframework.web.util.UrlPathHelper.PATH".
at org.springframework.util.Assert.notNull(Assert.java:201)
at org.springframework.web.util.UrlPathHelper.getResolvedLookupPath(UrlPathHelper.java:213)
at org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getMatchingCondition(PatternsRequestCondition.java:280)
at org.springframework.web.servlet.mvc.method.RequestMappingInfo.getMatchingCondition(RequestMappingInfo.java:406)
I tried to look up online and found https://github.com/spring-projects/spring-framework/issues/27715 but I am not able to relate as the issue says something about building mappings yourself which I am not doing at all. I am invoking the Rest Endpoint using a MockMvc object which hits the above code.