-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Labels
status: duplicateA duplicate of another issueA duplicate of another issue
Description
Spring boot version: 2.4.3
Sample code: https://github.com/rsenden/spring-boot-converter-issue
The sample code in the repository listed above runs fine with ./gradlew bootRun
, but fails when running java -jar build/libs/demo-0.0.1-SNAPSHOT.jar
.
Basically, binding a property to a java.io.File
field fails if the property contains a non-existing Windows path, for example C:\Temp\SomeNonExistingFile.txt
. This is caused by the org.springframework.boot.convert.StringToFileConverter.convert(String)
method calling resource.exists()
, which fails when the resource points to a fully qualified Windows-style path when running with org.springframework.boot.loader.LaunchedURLClassLoader
.
Metadata
Metadata
Assignees
Labels
status: duplicateA duplicate of another issueA duplicate of another issue