Closed timguy closed 2 years ago
Add a @RegisterForReflection(targets = com.amazonaws.auth.AWS4Signer.class)
annotation on any of your application class.
If it fixes your issues, I'll incorporate it too into the extension.
Thank you, this helped.
Now I am one step further. I post it here, tell me when I should open a new issue for that:
Can you add this resources in the quarkus-amazon-alexa configuration: "com/amazonaws/partitions/endpoints.json"?
2022-09-14 18:37:19,544 INFO [io.quarkus] (main) theskill 1.0.0-SNAPSHOT native (powered by Quarkus 2.12.1.Final) started in 0.013s.
2022-09-14 18:37:19,548 INFO [io.quarkus] (main) Profile prod activated.
2022-09-14 18:37:19,548 INFO [io.quarkus] (main) Installed features: [amazon-alexa, amazon-lambda, cdi]
START RequestId: 1db76a46-f68a-4654-9db4-ae228d3fce6f Version: $LATEST
2022-09-14 18:37:19,565 ERROR [io.qua.ama.lam.run.AbstractLambdaPollLoop] (Lambda Thread (NORMAL)) Failed to run lambda (NORMAL): com.amazonaws.SdkClientException: Unable to load partition metadata from com/amazonaws/partitions/endpoints.json
at com.amazonaws.partitions.PartitionsLoader.build(PartitionsLoader.java:82)
at com.amazonaws.regions.RegionMetadataFactory.create(RegionMetadataFactory.java:30)
at com.amazonaws.regions.RegionUtils.initialize(RegionUtils.java:64)
at com.amazonaws.regions.RegionUtils.getRegionMetadata(RegionUtils.java:52)
at com.amazonaws.regions.RegionUtils.getRegion(RegionUtils.java:105)
at com.amazonaws.client.builder.AwsClientBuilder.getRegionObject(AwsClientBuilder.java:254)
at com.amazonaws.client.builder.AwsClientBuilder.setRegion(AwsClientBuilder.java:434)
at com.amazonaws.client.builder.AwsClientBuilder.configureMutableProperties(AwsClientBuilder.java:402)
at com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46)
at com.amazon.ask.attributes.persistence.impl.DynamoDbPersistenceAdapter.<init>(DynamoDbPersistenceAdapter.java:114)
at com.amazon.ask.attributes.persistence.impl.DynamoDbPersistenceAdapter.<init>(DynamoDbPersistenceAdapter.java:46)
at com.amazon.ask.attributes.persistence.impl.DynamoDbPersistenceAdapter$Builder.build(DynamoDbPersistenceAdapter.java:350)
at com.amazon.ask.module.StandardSdkModule$Builder.build(StandardSdkModule.java:206)
at com.amazon.ask.builder.StandardSkillBuilder.getConfigBuilder(StandardSkillBuilder.java:100)
at com.amazon.ask.builder.StandardSkillBuilder.build(StandardSkillBuilder.java:109)
at github.timguy.theskill.StreamHandler.getSkill(StreamHandler.java:84)
at github.timguy.theskill.StreamHandler.<init>(StreamHandler.java:88)
at github.timguy.theskill.StreamHandler_Bean.create(Unknown Source)
at github.timguy.theskill.StreamHandler_Bean.get(Unknown Source)
at github.timguy.theskill.StreamHandler_Bean.get(Unknown Source)
at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:468)
at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:481)
at io.quarkus.arc.impl.ArcContainerImpl$1.get(ArcContainerImpl.java:285)
at io.quarkus.arc.impl.ArcContainerImpl$1.get(ArcContainerImpl.java:282)
at io.quarkus.arc.runtime.BeanContainerImpl$1.create(BeanContainerImpl.java:36)
at io.quarkus.arc.runtime.BeanContainer.instance(BeanContainer.java:19)
at io.quarkus.amazon.lambda.runtime.AmazonLambdaRecorder$1.processRequest(AmazonLambdaRecorder.java:191)
at io.quarkus.amazon.lambda.runtime.AbstractLambdaPollLoop$1.run(AbstractLambdaPollLoop.java:117)
at java.lang.Thread.run(Thread.java:833)
at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:705)
at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:202)
END RequestId: 1db76a46-f68a-4654-9db4-ae228d3fce6f
REPORT RequestId: 1db76a46-f68a-4654-9db4-ae228d3fce6f Duration: 35.64 ms Billed Duration: 60 ms Memory Size: 128 MB Max Memory Used: 17 MB Init Duration: 23.96 ms
OK, let's make progress in a PR and I will release once we get something working.
1.0.5 is now available on Maven Central. Thanks for your patience and your perseverance :).
I have a skill, wich I "quarkified" for faster runtime (just overwrite everything from the zip I got from https://code.quarkus.io/?b=GRADLE&e=io.quarkiverse.amazonalexa%3Aquarkus-amazon-alexa&extension-search=origin:platform%20alexa)
The AmazonDynamoDBClient is fetched because of my StreamHandler class and configuration withTableName("theskill_userData").
Both classes: com.amazonaws.auth.SignerFactory.createSigner(SignerFactory.java:172) com.amazonaws.auth.AWS4Signer are from aws-java-sdk-core-1.11.420
SignerFactory uses Class.newInstance which is marked as deprecated:
Could this give a hint how to fix this with quarkus/native? Maybe this could help as well: https://github.com/oracle/graal/issues/1367#issuecomment-500517930