无法为请求处理程序的客户端实例化请求处理程序链 'com.amazonaws.services.sqs.QueueUrlHandler'

Unable to instantiate request handler chain for client for request handler 'com.amazonaws.services.sqs.QueueUrlHandler'

我正在使用 aws-java-sdk-sqs 依赖项从 SQS 读取消息,出于项目原因,我们使用 :

将 AWS 依赖项重新定位到最终 jar 中的不同包结构
    <relocation>
          <pattern>com.amazonaws</pattern>
          <shadedPattern>com.shaded.amazonaws</shadedPattern>
    </relocation>

我正在使用代码创建 SQS 客户端

AmazonSQS amazonSQS = AmazonSQSClientBuilder.standard().withRegion(region).build();

我在使用此代码时遇到错误:

com.shaded.amazonaws.AmazonClientException: Unable to instantiate request handler chain for client: Unable to instantiate request handler chain for client. Listed request handler ('com.amazonaws.services.sqs.QueueUrlHandler') does not implement the interface com.shaded.amazonaws.handlers.RequestHandler API.

更新------------------------------------- -------------------------------------->

原因:

This issue is because of

requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/sqs/request.handlers")); 
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/sqs/request.handler2s"));

These file 'request.handlers' contains fully qualified handler names. Which maven shade plugin has not take care of while relocating.

有什么方法可以在 maven 的帮助下重新定位这些文件吗?或者任何其他解决方法,有人找到了吗?

我已经使用此命令更新了最终的 jar 文件,在 Maven 构建部分完成后立即在构建管道中更新。

jar uf jar-file input-file(s)

我已经在构建服务器上放置了一个编辑过的 'request.handlers' 并使用此命令替换了现有的内部 jar。

https://docs.oracle.com/javase/tutorial/deployment/jar/update.html