Open iAMSagar44 opened 6 months ago
From the error message, the org.apache.commons.logging.LogFactory
was initialized at build time, while it should be initialized at run time. You can try to force this class to be initialized at run time using --initialize-at-run-time
option.
You can add this option in pom.xml
.
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<buildArgs>
<buildArg>--initialize-at-run-time=org.apache.commons.logging.LogFactory</buildArg>
</buildArgs>
</configuration>
</plugin>
You may need to force more classes to be initialized at run time due to transitive dependencies.
I am trying to build a native image of a Spring AI based application using Native Build tools and am getting an error while building the native image. The error is due to the Spring AI Tika document reader dependency, as I am only getting this error when I have this dependency in the pom.xml.
Native image version used -
Error during native image build -
I traced the initialisation of these classes and noticed this in the logs when I tried to build the native-image -
I also tried registering hints for reflection but couldn't get the application working. Is there a way to resolve this issue?