Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Working with application.properties files #394

Open
shalastra opened this issue Oct 17, 2020 · 0 comments
Open

Working with application.properties files #394

shalastra opened this issue Oct 17, 2020 · 0 comments

Comments

@shalastra
Copy link

shalastra commented Oct 17, 2020

What happened?

My application is using application.properties file with values generated during build by Gradle. After executing nativeimage the resources are not attached(?) hence the application crashes.

I have tried something like this:

option '-H:IncludeResources=\'src/main/resources/application.properties$\''

as well, as regex:

option '-H:IncludeResources=\'.*/application.*properties$\''

I followed this instructions:
https://github.com/oracle/graal/blob/master/substratevm/Resources.md

And here the way I load resources:

InputStream resourceAsStream = MainApplication.class.getResourceAsStream("/application.properties");

And exception I'm getting when executing the native image:

Exception in thread "main" java.lang.NullPointerException: inStream parameter is null

What did you want to happen?

Clarify how to use application.properties with native image.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant