Skip to content

Allow whitelist to be loaded from fat jar files - #1465

Merged
olegz merged 1 commit into
spring-cloud:mainfrom
scottfrederick:deser-types-fat-jar
Sep 29, 2026
Merged

olegz merged 1 commit into
spring-cloud:mainfrom
scottfrederick:deser-types-fat-jar

Conversation

@scottfrederick

Copy link
Copy Markdown
Contributor

The commit 0c5d5f3 added support for a META-INF/deserializable.types file that is read to determine the set of types that can be loaded by JsonMessageConverter. The file is read as a resource from the classpath.

When the file is in a jar file that is nested within another jar file (for example, a Spring Boot fat jar), the Files.readAllLines(Path.of(uri)) used to read the file as a resource will fail, preventing the message conversion.

This PR changes the file reading to use the streams API instead of the File API, which works when the file is in a flat jar or in a nested jar.

When a `META-INF/deserializable.types` file is located in a jar file
nested inside another jar file (for example, a Spring Boot fat jar),
it can be found as a resource but can't be read with
`Files.readAllLines`.

This commit changes the file reading to use an input stream that
allows the file to be read in this scenario.

Signed-off-by: Scott Frederick <scottyfred@gmail.com>
@olegz
olegz merged commit 389404c into spring-cloud:main Sep 29, 2026
2 checks passed
@olegz olegz added this to the 5.0.0-M2 milestone Sep 29, 2026
@scottfrederick
scottfrederick deleted the deser-types-fat-jar branch September 29, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants