Originally raised in spring-projects/spring-boot#42929 by @milazzo-g. This looks like a problem introduced by #33712, but I'm not sure if the fix should be in framework or the third-party library.
During context loading the ResourceHttpRequestHandler class scans all possible paths and if these do not end with "/" an IllegalArgumentException type exception is thrown with message "Resource location does not end with slash: …" (see ResourceHttpRequestHandler@282 the call to ResourceHttpRequestHandler::assertLocationPath) this cause several issue with various jar included (in our case camunda-webapp-webjar 7.22.0 - included by camunda-bpm-spring-boot-starter-root 7.22.0).
The path provided by the library is "classpath:/META-INF/resources/webjars/camunda" which as you can see does not contain the final "/". makes it unusable with spring-boot 6.2.0-RC3.
We temporary fixed creating a copy of org.springframework.web.servlet.resource.ResourceHttpRequestHandler in our src folder and modifying starting from line 282 from:
ResourceHandlerUtils.assertLocationPath(location);
to:
try {
ResourceHandlerUtils.assertLocationPath(location);
} catch (Exception e) {
if (org.apache.commons.lang3.StringUtils.containsIgnoreCase(e.getMessage(), "resource location does not end with slash")){
location += "/";
}else {
throw e;
}
}
this solved the issue. Could you please fix it in a next minor?
KR.
Giuseppe.


STACKTRACE.txt
Originally raised in spring-projects/spring-boot#42929 by @milazzo-g. This looks like a problem introduced by #33712, but I'm not sure if the fix should be in framework or the third-party library.
During context loading the
ResourceHttpRequestHandlerclass scans all possible paths and if these do not end with "/" anIllegalArgumentExceptiontype exception is thrown with message "Resource location does not end with slash: …" (seeResourceHttpRequestHandler@282the call toResourceHttpRequestHandler::assertLocationPath) this cause several issue with various jar included (in our casecamunda-webapp-webjar7.22.0 - included bycamunda-bpm-spring-boot-starter-root7.22.0).The path provided by the library is "classpath:/META-INF/resources/webjars/camunda" which as you can see does not contain the final "/". makes it unusable with
spring-boot6.2.0-RC3.We temporary fixed creating a copy of
org.springframework.web.servlet.resource.ResourceHttpRequestHandlerin our src folder and modifying starting from line 282 from:ResourceHandlerUtils.assertLocationPath(location);to:
this solved the issue. Could you please fix it in a next minor?
KR.
Giuseppe.
STACKTRACE.txt