org.springframework.web.context.ContextLoader cannot be loaded in a native image #29905
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
theme: aot
An issue related to Ahead-of-time processing
type: bug
A general bug
Milestone
Affects: 6.0.x
Loading
org.springframework.web.context.ContextLoader
in a native image fails due to its class initializer trying to loadorg/springframework/web/context/ContextLoader.properties
and failing as it's not present in the image. The problem used to be masked by Tomcat as it resource config such that all*.properties
files were included in the image. This has been tightened up in Tomcat.This failure was first seen with Spring HATEOAS:
It can be reproduced in any web app by trying to call
ContextLoader
at runtime. For example:The above main method will output the following at startup:
The text was updated successfully, but these errors were encountered: