hlteoh37 commented on code in PR #15:
URL:
https://github.com/apache/flink-connector-aws/pull/15#discussion_r1026732902
##########
flink-sql-connector-dynamodb/pom.xml:
##########
@@ -77,12 +77,16 @@ under the License.
<include>org.apache.httpcomponents:*</include>
<include>io.netty:*</include>
<include>commons-logging:commons-logging</include>
+
<include>commons-codec:commons-codec</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>software.amazon</pattern>
<shadedPattern>org.apache.flink.connector.dynamodb.shaded.software.amazon</shadedPattern>
+
<excludes>
+
<exclude>software.amazon.awssdk.enhanced.**</exclude>
+
</excludes>
Review Comment:
We cannot shade these because EnhancedDynamoDB uses an additional
interceptor in the AWS SDK chain. The ChainFactory resolves this a manner that
the shade plugin doesn't handle properly.
https://github.com/aws/aws-sdk-java-v2/blob/master/core/sdk-core/src/main/java/software/amazon/awssdk/core/interceptor/ClasspathInterceptorChainFactory.java#L42
```
Caused by: java.lang.ClassNotFoundException:
software.amazon.awssdk.enhanced.dynamodb.internal.ApplyUserAgentInterceptor
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at
org.apache.flink.util.FlinkUserCodeClassLoader.loadClassWithoutExceptionHandling(FlinkUserCodeClassLoader.java:68)
at
org.apache.flink.util.ChildFirstClassLoader.loadClassWithoutExceptionHandling(ChildFirstClassLoader.java:74)
at
org.apache.flink.util.FlinkUserCodeClassLoader.loadClass(FlinkUserCodeClassLoader.java:52)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at
org.apache.flink.streaming.connectors.dynamodb.shaded.software.amazon.awssdk.core.internal.util.ClassLoaderHelper.loadClass(ClassLoaderHelper.java:115)
at
org.apache.flink.streaming.connectors.dynamodb.shaded.software.amazon.awssdk.core.internal.util.ClassLoaderHelper.loadClass(ClassLoaderHelper.java:74)
at
org.apache.flink.streaming.connectors.dynamodb.shaded.software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory.createExecutionInterceptor(ClasspathInterceptorChainFactory.java:123)
... 37 more
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]