Issue in OCI Java SDK Deserialization of LifecycleState Enum during ListVcns Call

オープン
#693 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
api

調査の方向性

まず com.oracle.bmc.core.model.Vcn.LifecycleState と、shaded OCI Java SDK が使用するデシリアライゼーションパスから始め、次に issue の ListVcns 呼び出しを再現します。lifecycleState="AVAILABLE" を含むレスポンスが InvalidFormatException を発生させなくなり、選択したフォールバック動作に従えば完了です。

索引モデルが issue の本文から書いたものです。

説明

Dear Oracle Support Team,

We are encountering a critical issue while using the OCI Java SDK (version oci-java-sdk-shaded-full-3.66.0) when calling the ListVcns API.

🔍 Issue Summary
The API returns lifecycleState = "AVAILABLE" (all uppercase), but the SDK expects the enum value as Available (PascalCase). This mismatch causes a com.fasterxml.jackson.databind.exc.InvalidFormatException during deserialization of the response into the SDK model class com.oracle.bmc.core.model.Vcn.

❗ Error Stack Trace (Excerpt)
vbnet
Copy
Edit
Caused by: shaded.com.oracle.oci.javasdk.com.fasterxml.jackson.databind.exc.InvalidFormatException:
Cannot deserialize value of type com.oracle.bmc.core.model.Vcn$LifecycleState from String "AVAILABLE":
not one of the values accepted for Enum class: [Terminated, UnknownEnumValue, Available, Provisioning, Terminating, Updating]
at [Source: (InputStream); line: 1, column: 875]
(through reference chain: java.util.ArrayList[0]->com.oracle.bmc.core.model.Vcn["lifecycleState"])
🧪 Reproduction Code
java
Copy
Edit
ListVcnsRequest request = ListVcnsRequest.builder()
.compartmentId("")
.lifecycleState(Vcn.LifecycleState.Available)
.build();

ListVcnsResponse response = virtualNetworkClient.listVcns(request);
📌 Observations
The Jackson deserializer used is from the shaded OCI SDK itself:
shaded.com.oracle.oci.javasdk.com.fasterxml.jackson.databind

The API response contains "AVAILABLE" (uppercase), but the SDK expects "Available", hence deserialization fails.

Although the enum includes UnknownEnumValue, it is not triggered because Jackson fails before enum fallback logic is invoked.

This causes a client-side error with HTTP code -1 and message: "Unknown error".

✅ Expected Behavior
The SDK should either:

Allow case-insensitive enum deserialization (e.g., AVAILABLE → Available), or

Fall back to UnknownEnumValue instead of throwing an exception.

🌐 Region & Endpoint
Region: ap-hyderabad-1

Endpoint: https://iaas.ap-hyderabad-1.oraclecloud.com/20160918/vcns

📦 SDK Version
OCI Java SDK: oci-java-sdk-shaded-full-3.66.0

Kindly advise if this is a known issue or if a fix/workaround is available. If needed, we can provide the full JSON response and debug logs.

Thanks & Regards,
suriya B

主要言語
Java
スター
243
フォーク
171
平均マージ
5分
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oracle/oci-java-sdk のほかの issue

oracle/oci-java-sdk の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。