Jackson deserialization issue with Kotlin and data classes
還沒有人認領這個 Issue。
評估
研究方向
從 build.gradle.kts 開始,將與 Azurite 搭配使用的相依性設定與 Azure 中使用的設定進行比較。追蹤如何為已部署的 Kotlin 工作負載設定 durable task data converter;當 OrchestratorInput 和類似的 Kotlin 資料類別能在 Azure 中不使用預設建構函式值完成反序列化時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
I have a simple durable orchestration function written in Kotlin who's input type is
data class OrchestratorInput(val value: String)
When I run my orchestration, it fails to deserialize JSON text into an instance of OrchestratorInput, probably because data classes in Kotlin does not have any no-arg constructor unless I assign default values to all fields of the class. The output of the orchestration is shown below, containing the error message:
{
"name": "OrchestrationFunction",
"instanceId": "f340b4b5-b04d-43a0-bd83-40a12ab419ec",
"runtimeStatus": "Failed",
"input": {
"value": "hello, world!"
},
"customStatus": "",
"output": "com.microsoft.durabletask.DataConverter$DataConverterException: Failed to deserialize the JSON text to org.example.OrchestratorInput. Detailed error message: Cannot construct instance of `org.example.OrchestratorInput` (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 2]",
"createdTime": "2026-03-10T11:31:29Z",
"lastUpdatedTime": "2026-03-10T11:31:39Z"
}
Adding jackson-module-kotlin to build.gradle.kts did not help, although it helped when running the orchestration locally with Azurite
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.21.1")
For some reason the module is not picked up when running in Azure. Is there any way to fix this? Now I'm forced to assign default values to every field of every data class used as input or output of orchestration- and activity functions, which makes the code very verbose.
- 主要語言
- Java
- 星號
- 29
- 分支
- 18
- 平均合併
- 1 天 10 小時
- 30 天內合併 PR
- 2
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/durabletask-java 的其他 Issue
-
Needs: Triage :mag:
難度 4/5 3-5 天 新手友好度 48/100
microsoft/durabletask-java#303 ·
-
Needs: Triage :mag:
難度 4/5 3-5 天 新手友好度 45/100
microsoft/durabletask-java#290 · 2 則留言 ·
-
Needs: Triage :mag:
難度 5/5 一週以上 新手友好度 35/100
microsoft/durabletask-java#285 ·
-
Needs: Triage :mag:
難度 3/5 1-2 天 新手友好度 68/100
microsoft/durabletask-java#276 ·
-
Enhancement
microsoft/durabletask-java#274 · 1 個 reaction · 已指派 2 人 ·
查看 microsoft/durabletask-java 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 76/100
-
bug needs triage
難度 2/5 1-3 小時 新手友好度 76/100
-
難度 1/5 1 小時以內 新手友好度 94/100
objectionary/hone-maven-plugin#1061 ·
-
type:bug
難度 2/5 1-3 小時 新手友好度 72/100