-
Notifications
You must be signed in to change notification settings - Fork 909
Fix GraalVM configuration of software.amazon.awssdk:apache-client
#3428
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
Conversation
The GraalVM configuration of `software.amazon.awssdk:apache-client` is incomplete. Without this change, `software.amazon.awssdk.http.apache.pacheHttpClient` fails with: ``` Caused by: java.lang.ExceptionInInitializerError: null at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:151) at java.lang.Class.ensureInitialized(DynamicHub.java:525) at software.amazon.awssdk.http.apache.ApacheHttpClient$ApacheConnectionManagerFactory.getPreferredSocketFactory(ApacheHttpClient.java:658) at software.amazon.awssdk.http.apache.ApacheHttpClient$ApacheConnectionManagerFactory.create(ApacheHttpClient.java:637) at software.amazon.awssdk.http.apache.ApacheHttpClient.createClient(ApacheHttpClient.java:151) at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:125) at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:104) at software.amazon.awssdk.http.apache.ApacheHttpClient$DefaultBuilder.buildWithDefaults(ApacheHttpClient.java:629) at software.amazon.awssdk.http.SdkHttpClient$Builder.build(SdkHttpClient.java:69) at io.micronaut.aws.sdk.v2.client.apache.ApacheClientFactory.doCreateClient(ApacheClientFactory.java:62) at io.micronaut.aws.sdk.v2.client.apache.ApacheClientFactory.apacheClient(ApacheClientFactory.java:47) at io.micronaut.aws.sdk.v2.client.apache.$ApacheClientFactory$ApacheClient0$Definition.build(Unknown Source) at io.micronaut.context.DefaultBeanContext.resolveByBeanFactory(DefaultBeanContext.java:2354) ... 81 common frames omitted Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl (Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl) at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1158) at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:960) at java.security.AccessController.executePrivileged(AccessController.java:169) at java.security.AccessController.doPrivileged(AccessController.java:83) at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:957) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:624) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655) at org.apache.http.conn.ssl.AbstractVerifier.<init>(AbstractVerifier.java:61) at org.apache.http.conn.ssl.AllowAllHostnameVerifier.<init>(AllowAllHostnameVerifier.java:44) at org.apache.http.conn.ssl.AllowAllHostnameVerifier.<clinit>(AllowAllHostnameVerifier.java:46) ... 94 common frames omitted Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:52) at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.lang.ClassLoader.loadClass(ClassLoader.java:133) at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1020) ```
Can be removed once aws/aws-sdk-java-v2#3428 is released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for your contribution!
Kudos, SonarCloud Quality Gate passed!
|
Looks like our native image tests failed after this change
|
Where is that |
You can use the commands here to reproduce the issue https://github.com/aws/aws-sdk-java-v2/blob/master/buildspecs/archetype-native-image-test.yml#L7-L26 Note that you need to clone aws-sdk-java-v2 repo first. |
It worked for me:
Using GraalVM CE 22.2.0 (JDK 11) |
Thanks for verifying. We use JDK 8 to run the tests; not sure if it only fails on JDK 8. We will take a look |
Java 8 support was removed in GraalVM CE 21.3.0, 1 year ago. Since then, there have been 3 releases (22.0 in January, 22.1 in April and 22.2 in July). 22.3 is coming out next month. Note that I generated the config changes in this PR by using a 22.2 agent. If you have a 21.2 version locally, please try the tests yourself. |
Kudos, SonarCloud Quality Gate passed!
|
The GraalVM configuration of
software.amazon.awssdk:apache-client
is incomplete. Without this change,software.amazon.awssdk.http.apache.ApacheHttpClient
fails with:Motivation and Context
Modifications
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License