-
Notifications
You must be signed in to change notification settings - Fork 8
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
Different output for native image and JVM applications #1
Comments
Please try generating the native image locally ( Are you trying v1.0.2? because on a previous version, there was a similar bug. |
Yes, I am using source tag v1.0.2 / master. What was the previous issue did you face? |
Did you tried generating the native image locally to see if you can reproduce the issue? Which OS are you trying? The previous issue was similar to what you report, moving everything to the |
I tried: -
The results were the same. The images were moved to the |
Interesting, by trying with other data, it seems I was able to reproduce the problem. I'll work in a fix and keep you updated, thanks for reporting. |
Ok, I found the issue, turns out that the metadata-extractor library used to detect the creation date on the files, uses reflexion, hence, those classes doesn't get into the native image. So, there are two fixes:
I'll work on the fixes tomorrow. |
I submitted a PR for a configuration to include the reflection classes into the native image build. It works for me and I hope it is useful for you too. |
I'll do a pre-release soon which should get better behaviour but still different, I have also included the option to print debug logs. There is an issue I haven't been able to fix, which is preventing the native build to work with other files, in case you have any idea:
|
If you can share the photo with me I can take a look |
I found one, I find it weird because I have two photos that were taken consecutively, one which is processed properly, and this one which fails while exacting the metadata, from what I saw, the problem relates while parsing XMP related metadata which should help to fix the issue: The actual photo |
Just tried the photo. The application crashed by the runtime exception. I am looking for another photo metadata library which is not using reflection unless, of course, this is the only Java library available. |
Can you print the stracktrace that crashed it? locally, I get the metadata parsing exception logged but the app continues looking on the remaining files. Another library could be an alternative. |
The stack trace I got was exactly the one you had earlier, |
Given the discussion on the metadata-extractor library, it seems reflection isn't used on purpose, but most likely inherited from xmpcore, so, including the whole classes on |
Yesterday, I looked a bit into the error, unfortunately, no progress so far. I tried including the whole xmpcore library, but it made no difference, then, looking a bit more into the error message, it looks like the problem may not be related to the reflection involved in such library, but a missing resource (I don't know which kind of resource yet). It seems like the error will be a bit time consuming to debug, so, I don't expect to do much progress until the weekend, I will try compiling the library locally to add more debug logs, so that we understand what resource is being tried to load, and why, If you have a better idea, please let me know. |
I have a hunch that the native-image didn't include the SAXMessages.properties into the executable image. I am trying to get a plain class to work with properties files in the executable form. https://app.slack.com/client/TN37RDLPK/CNBFR78F9/thread/CNBFR78F9-1601398294.078500 |
You have posted a private link. |
Perhaps this might help, However, it does not matter much now as I have understood and fixed the problem |
After merging your PR, my whole test data works on the native image, I'm closing the issue for now. Thanks! |
When the application runs under the JVM, it performs correctly. My images are moved to the
organized/
directory. If I run it in its native image, my images are moved toinvalid/
directory. I am using GraalVM CE 20.0.0 Java 11 for both in Windows and Linux.The text was updated successfully, but these errors were encountered: