Misleading exception when endpoint isn't configured. java.lang.NullPointerException: "this.httpClient" is null
まだ誰も着手していません。
評価
調査の方向性
ContainerInstanceClient.builder().build(provider) の例からエンドポイントがない場合を再現し、ClientCall.method と ContainerInstanceClient.createContainerInstance を通るスタックトレースを追跡します。2.x の動作と比較して、想定される早期失敗の動作を確認し、エンドポイントに関する指針について Oracle ドキュメントの例を確認します。エンドポイントがない場合に null httpClient 例外が発生しなくなり、ドキュメントに記載された使用方法が明確になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
This is a low-priority issue, but when calling the API without an endpoint the SDK appears to not be configuring the http client, rather than throwing an error early-on informing the user that an endpoint is required. This only occurs on 3.x, 2.x properly throws an error for the missing endpoint early-on.
Code to reproduce:
this.containerClient = ContainerInstanceClient
.builder()
// .endpoint("https://compute-containers.us-ashburn-1.oci.oraclecloud.com") // Omit to reproduce.
.build(provider);
// Call any API now.
Stacktrace:
Caused by: java.lang.NullPointerException: Cannot invoke "com.oracle.bmc.http.client.HttpClient.createRequest(com.oracle.bmc.http.client.Method)" because "this.httpClient" is null
at com.oracle.bmc.http.internal.ClientCall.method(ClientCall.java:173)
at com.oracle.bmc.containerinstances.ContainerInstanceClient.createContainerInstance(ContainerInstanceClient.java:202)
... 5 more
It should also be noted that the Oracle docs that give the SDK copy/paste examples don't tell you that you need to configure the endpoint.
- 主要言語
- Java
- スター
- 243
- フォーク
- 171
- 平均マージ
- 5分
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
oracle/oci-java-sdk のほかの issue
-
NoSuchMethodError in the circuit breaker since 3.103.0 when resilience4j 2.x is on the classpathオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
oracle/oci-java-sdk#803 ·
-
SDK
難易度 1/5 1時間未満 初心者へのやさしさ 20/100
oracle/oci-java-sdk#788 ·
-
Identity Domains
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
oracle/oci-java-sdk#764 · コメント 3 件 ·
-
SDK
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
oracle/oci-java-sdk#726 · コメント 1 件 ·
-
Object Storage
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
oracle/oci-java-sdk#723 · リアクション 1 件 ·
oracle/oci-java-sdk の issue をすべて見る
似ている issue
-
enhancement infra
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
5.0.x backport bug
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
spring-cloud/spring-cloud-function#1569 ·
メンテナーはふだん 1 日以内に返信
-
Move the spring-cloud-commons version and BOM import from the bus parent to the stream parent対応中かも @olegz が今日担当しました。 オープンtask
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
spring-cloud/spring-cloud-stream#3355 ·
メンテナーはふだん 1 日以内に返信
-
area:cpan-port area:performance bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fglock/PerlOnJava#2230 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100