microsoft / microsoft/durabletask-java
Jackson deserialization issue with Kotlin and data classes
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 29
- フォーク
- 18
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 2
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
build.gradle.kts から始め、Azurite で使用されている依存関係の設定と Azure で使用されているものを比較します。デプロイされた Kotlin ワークロード向けに durable task data converter がどのように構成されているかを追跡します。OrchestratorInput や同様の Kotlin データクラスが、デフォルトのコンストラクター値なしで Azure でデシリアライズできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, kotlin
- 領域
- backend, cloud
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100