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

未關閉
#693 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
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,並遵循選取的 fallback 行為。

由索引模型根據 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 分鐘
30 天內合併 PR
4

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

oracle/oci-java-sdk 的其他 Issue

查看 oracle/oci-java-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。