mercredi 31 mars 2021

netty Reflective Access Unsupported

I have an AWS Firehose Client running in my lambda fucntion. It is instantiated as shown below.

  private static FirehoseAsyncClient firehoseClient =
      FirehoseAsyncClient.builder()
          .region(Region.of(Env.getRegion()))
          .credentialsProvider(EnvironmentVariableCredentialsProvider.create())
          .overrideConfiguration(
              ClientOverrideConfiguration.builder()
                  .apiCallAttemptTimeout(Duration.ofSeconds(3))
                  .retryPolicy(
                      RetryPolicy.builder()
                          .backoffStrategy(BackoffStrategy.defaultStrategy())
                          .retryCondition(RetryCondition.defaultRetryCondition())
                          .numRetries(10)
                          .build())
                  .build())
          .build();

When we do a PutRecord, i'm getting below exception, which is similar to the one specified here. Since it is running as a normal lambda function, i couldnt find a way to specify -Dio.netty.tryReflectionSetAccessible=true/false as specified in the other SO answer.

java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
    at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31)
    at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:238)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:232)
    at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:293)
    at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:92)
    at io.netty.util.ConstantPool.<init>(ConstantPool.java:32)
    at io.netty.channel.ChannelOption$1.<init>(ChannelOption.java:36)
    at io.netty.channel.ChannelOption.<clinit>(ChannelOption.java:36)
    at software.amazon.awssdk.http.nio.netty.internal.SdkChannelOptions.<init>(SdkChannelOptions.java:31)
    at software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient$DefaultBuilder.<init>(NettyNioAsyncHttpClient.java:464)
    at software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient$DefaultBuilder.<init>(NettyNioAsyncHttpClient.java:461)
    at software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient.builder(NettyNioAsyncHttpClient.java:126)
    at software.amazon.awssdk.http.nio.netty.NettySdkAsyncHttpService.createAsyncHttpClientFactory(NettySdkAsyncHttpService.java:29)
    at java.base/java.util.Optional.map(Unknown Source)
    at software.amazon.awssdk.core.internal.http.loader.DefaultSdkAsyncHttpClientBuilder.buildWithDefaults(DefaultSdkAsyncHttpClientBuilder.java:42)
    at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.lambda$resolveAsyncHttpClient$8(SdkDefaultClientBuilder.java:285)
    at java.base/java.util.Optional.orElseGet(Unknown Source)
    at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.resolveAsyncHttpClient(SdkDefaultClientBuilder.java:285)
    at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.finalizeAsyncConfiguration(SdkDefaultClientBuilder.java:236)
    at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.asyncClientConfiguration(SdkDefaultClientBuilder.java:181)
    at software.amazon.awssdk.services.firehose.DefaultFirehoseAsyncClientBuilder.buildClient(DefaultFirehoseAsyncClientBuilder.java:28)
    at software.amazon.awssdk.services.firehose.DefaultFirehoseAsyncClientBuilder.buildClient(DefaultFirehoseAsyncClientBuilder.java:22)
    at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build(SdkDefaultClientBuilder.java:129)
    at com.crowdblink.software.eventrepo.container.factory.KinesisFirehoseClientFactory.<clinit>(KinesisFirehoseClientFactory.java:42)
    at com.xxxx.software.eventrepo.container.EventsApiLambdaHandler.sendAsyncBackup(EventsApiLambdaHandler.java:246)
    at com.xxxx.software.eventrepo.container.EventsApiLambdaHandler.lambda$backupPostAndPatch$2(EventsApiLambdaHandler.java:220)
    at java.base/java.util.concurrent.CompletableFuture.biApply(Unknown Source)
    at java.base/java.util.concurrent.CompletableFuture$BiApply.tryFire(Unknown Source)
    at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)

Any ideas?





Aucun commentaire:

Enregistrer un commentaire