Closed ganeshs4 closed 2 weeks ago
One note: the above problem happens on the 2.0 release of the library, it seems like this particular issue has been fixed on the develop
branch - https://github.com/Pi4J/pi4j-v2/issues/141
The proxies have been removed, so this shouldn't be an issue anymore.
I have been trying to generate java native image (graalvm) for my home automation project which uses pi4j library (it's an amazing library for raspberry pi!).
The native-image is created without any issues. However, when trying to run the native-image, I ran into below issue:
Steps to recreate the issue:
Step 1: Download and unzip graalvm CE on ARM64 (raspberry pi) Step 2: Run the below command to generate the native image
Step 3: Contents of /home/rpi/deps/proxy-config.json
I checked with the graalvm community (thanks to Vojin Jovanovic and Aleksandar Gradinac) and seems like the reason the native image is failing with the above exception is because - the order of proxy keeps changing and if the order doesn't match we will see above exception when trying to execute the native image. They recommend adding the proxies in the same order every time. Below are the snippets from my conversation with Aleksandar Gradinac - explaining what is going wrong:
Their recommendation was: