Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant