-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[native-image] Classpath not honored when adding resources #1988
Comments
Hello @ozppupbg,
Which API do you use to get hold of that file? Can you paste that snippet? Is it the |
Hello @jaikiran, I tried By now I also verified, that all included MANIFEST.MF files seem to present in the binary as strings. These should be the code parts resposible for getting the resource file if I use this method: graal/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JavaNetSubstitutions.java Lines 187 to 197 in d30871f
graal/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Resources.java Lines 72 to 108 in 36e9f9b
If multiple resources with the same name are registered, the first one should be "winning". Regards, Oz |
Thank you for your report @ozppupbg and apologies for the late reply. The resources should indeed be in the order in which they are found on the class path for |
PR #3315 will fix this issue. |
The PR that fixes this problem is on a master for a while, so I'm going to close this issue. |
Hello,
I have an application, which reads its version information from the META-INF/MANIFEST.MF file. I added this file to the image resources, but the file I get at runtime is not from my jar.
I checked the resource inclusion with the option "-H:Log=registerResource:" and see 5 or 6 MANIFEST.MF files added.
Of course the last one wins and is the one present in the native image. As my only input is a single jar file I would have expected my version be in the image. But interesting enough it is neither the first MANIFEST.MF file in the classpath, but one in the middle.
As all jar files except mine, are from "graalvm/lib/svm/builder/" I don't see an easy way to fix this from my side.
I'm using the latest GraalVM Community Edition 19.3.0 amd64 for Linux.
Thank you!
Regards,
Oz
The text was updated successfully, but these errors were encountered: