Description
Hi,
I'm trying to compile dynamodb-enhanced client with Graalvm 21.1 and awssdk.version=2.16.50
Here the code:
DynamoDbTable<Book> dynamoDbTable = dynamoDbEnhancedClient.table(TABLE_NAME, TableSchema.fromBean(Book.class));
Reflection config doesn't help. I generated native-image artifacts with -agentlib: but it still doesn't help.
GraalVM 21.1 supports Method Handler, I hope it can be fixed.
https://github.com/aws/aws-sdk-java-v2/blob/master/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/mapper/LambdaToMethodBridgeBuilder.java#L76
Error:
Exception in thread "main" java.lang.ExceptionInInitializerError at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:315) Caused by: java.lang.IllegalArgumentException: Failed to generate method handle. at software.amazon.awssdk.enhanced.dynamodb.internal.mapper.LambdaToMethodBridgeBuilder.build(LambdaToMethodBridgeBuilder.java:92) at software.amazon.awssdk.enhanced.dynamodb.internal.mapper.ObjectConstructor.create(ObjectConstructor.java:37) at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.newObjectSupplierForClass(BeanTableSchema.java:361) at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.createStaticTableSchema(BeanTableSchema.java:172) at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.create(BeanTableSchema.java:129) at software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema.create(BeanTableSchema.java:121) at software.amazon.awssdk.enhanced.dynamodb.TableSchema.fromBean(TableSchema.java:81) at com.filichkin.blog.lambda.v3.handler.test.Main.initDispatcher(Main.java:39)
No problem with simple dynamoDb client, it can be compiled with GraalVM