-
Notifications
You must be signed in to change notification settings - Fork 354
Signer information SecurityException when building executable with native-image command #1699
Comments
Hey! Did you try to report that issue to the authors of |
Hi @mhalbritter , thanks for your update! I'm involved in this module, but I haven't found the reason and the solution yet! could you help give some suggestions? |
This looks like some class loading issue to me, not sure if related to spring native. Can these classes be loaded in a non-spring application running in a native image? |
No, I don't know how to do the test, could you help give a reference doc to test the similar library features? |
There is no reference documentation for that. I would create a plain java application with maven or gradle, add the
in there. This will cause the class to be loaded. Then compile the thing using the Native Build Tools to a native image. Then run that image and see if it crashes the same way. If it does, then it's not related to Spring Native and you can create an issue on the GraalVM repo. |
I have tested the class loading withe command Not only is the class |
Hi @mhalbritter , after I test your proposal scenario, it builds successfully without any exceptions. Use Native Build Tools to a native image failed due to the log4j initialization, it has been executed to I tried to fix the exceptions, but I need to research to find more configurations to solve, the test code is hosted in a new branch non-spring-app-build-demo. @mhalbritter Does this test show that it is related to Spring Native side? |
Your error above is related to build time initialization. I fiddled with your sample and the class loading works when putting the code in the I can reproduce even on the JVM by creating a class
@sdeleuze Have you seen something like this in the past? This could lead to a problem in SB3/SF6, as AFAIK we generate code in the same package as the spring beans. |
Hi @mhalbritter could you please help to find a workable solution? |
The only workaround I see here is to remove the digital signatures from the spring-cloud-azure-autoconfigure JAR. |
Not seen something like this yet, but worth creating a SB3/SF6 repro and report on Spring Framework bug tracker if confirmed. |
Reproducible with Spring AOT: spring-projects/spring-framework#29019 |
Let's tackle that issue on Spring Framework 6 side. |
Describe the issue
There's module
com.azure.spring:spring-cloud-azure-native-configuration
to enable the Spring Native support for Spring Cloud Azure libraries, when building executable with Spring native support, the following exceptions have occurred:Fatal error: java.lang.SecurityException: class "com.azure.spring.cloud.autoconfigure.compatibility.AzureCompatibilityVerifierAutoConfiguration"'s signer information does not match signer information of other classes in the same package
Or this class exception,
Error: Error loading a referenced type: java.lang.SecurityException: class "com.azure.spring.cloud.autoconfigure.compatibility.ContextBootstrapInitializer"'s signer information does not match signer information of other classes in the same package
If I run the command
mvn clean package
, then the below similar exception occurs:Caused by: java.lang.SecurityException: class "com.azure.spring.cloud.autoconfigure.compatibility.IssueAzureStorageNativeApplicationTestsContextInitializer"'s signer information does not match signer information of other classes in the same package
.If I run
mvn clean spring-boot:run
, it can run successfully.Before I push the artifacts to Maven, I can run native-image command locally success with local Spring Cloud Azure artifacts, the difference between the artifacts is that the artifacts of Maven have the extra digest information than the local artifacts. Please help to address this exception, thanks!
Steps to reproduce the issue
You can follow the sample project readme doc to reproduce this issue, it will connect to the local Azure Storage emulator.
Describe GraalVM and your environment:
More details
Here is the details log.
The text was updated successfully, but these errors were encountered: