I have the application packed in Graal native image.
I'm loading the properties using:
InputStream resourceAsStream = MainApplication.class.getResourceAsStream("/application.properties");
However, when I try to execute the binary, I'm getting the following error:
Exception in thread "main" java.lang.NullPointerException: inStream parameter is null
Turns out that Graal is not attaching my application.properties
file when the project is packed into native image.
I'm using Gradle and com.palantir.graal
with the following settings:
graal {
mainClass '<path-to-main-class>'
outputName '<output-name>'
javaVersion '11'
}
Is there a way I can use application.properties
from build/resources
?
option '-H:IncludeResources=\'.*/application.*properties$\''
I'm getting still the same error. – Forin