Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ClasspathSdkHttpServiceProvider return more helpful errors #3761

Closed
1 of 2 tasks
barryoneill opened this issue Feb 15, 2023 · 4 comments
Closed
1 of 2 tasks

Make ClasspathSdkHttpServiceProvider return more helpful errors #3761

barryoneill opened this issue Feb 15, 2023 · 4 comments
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue

Comments

@barryoneill
Copy link
Contributor

barryoneill commented Feb 15, 2023

Describe the feature

Rather than messages like:

[info]   software.amazon.awssdk.core.exception.SdkClientException: Multiple HTTP implementations were found on the classpath. To avoid non-deterministic loading implementations, please explicitly provide an HTTP client via the client builders, set the software.amazon.awssdk.http.async.service.impl system property with the FQCN of the HTTP service to use as the default, or remove all but one HTTP implementation from the classpath

It would be helpful to include information on which implementations were found.

Thanks!

Use Case

The recently release CRT library is of great interest to my group, and we're slowly bringing it into our projects. However, a few teams have repeatedly tripped on transitive dependencies bringing in alternative providers.

This often results in one of the possible undesirable outcomes:

  • They start setting system properties, which isn't often the most flexible solution
  • They don't know how to resolve this issue since they're just the victims of sudden transitive bloat on an upstream library
  • They rollback and don't bother upgrading the upstream library.

Proposed Solution

Instead of:

Multiple HTTP implementations were found on the classpath. To avoid non-deterministic loading implementations, please explicitly provide an HTTP client via the client builders, set the software.amazon.awssdk.http.async.service.impl system property with the FQCN of the HTTP service to use as the default, or remove all but one HTTP implementation from the classpath

It would be so much nicer if the message had the additional sentence:

.... remove all but one HTTP implementation from the classpath.  The multiple implementations found were [software.amazon.awssdk.http.crt.AwsCrtSdkHttpService, software.amazon.awssdk.http.nio.netty.NettySdkAsyncHttpService]

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Java SDK version used

19.0.2

JDK version used

2.20.4

Operating System and version

MacOS (all), Linux

@barryoneill barryoneill added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 15, 2023
@kovszilard
Copy link

❤️

@debora-ito
Copy link
Member

Nice improvement! We'll take a look.

@debora-ito debora-ito added needs-review This issue or PR needs review from the team. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 17, 2023
@debora-ito debora-ito self-assigned this Feb 17, 2023
@debora-ito debora-ito removed the needs-review This issue or PR needs review from the team. label Feb 21, 2023
@debora-ito debora-ito removed their assignment Feb 21, 2023
@debora-ito debora-ito added the p2 This is a standard priority issue label Feb 21, 2023
dagnir pushed a commit that referenced this issue Mar 11, 2023
* Issue #3761 - add culprit classnames to provider error messages

* Fix checkstyle errors
@barryoneill
Copy link
Contributor Author

barryoneill commented Jul 12, 2023

I can confirm this issue has been fixed since 2.20.23:

software.amazon.awssdk.core.exception.SdkClientException: Multiple HTTP implementations were found on the classpath. To avoid non-deterministic loading implementations, please explicitly provide an HTTP client via the client builders, set the software.amazon.awssdk.http.service.impl system property with the FQCN of the HTTP service to use as the default, or remove all but one HTTP implementation from the classpath.  The multiple implementations found were: [software.amazon.awssdk.http.apache.ApacheSdkHttpService,software.amazon.awssdk.http.urlconnection.UrlConnectionSdkHttpService]

Thank you @debora-ito and @dagnir !

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants