microsoft / microsoft/durabletask-java

Jackson deserialization issue with Kotlin and data classes

Đang mở
#270 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Needs: Triage :mag:
Ngôn ngữ chính
Java
Star
29
Fork
18
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
2

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với build.gradle.kts và so sánh cấu hình dependency được sử dụng với Azurite với cấu hình được sử dụng trong Azure. Truy tìm cách durable task data converter được cấu hình cho các workload Kotlin đã triển khai; hoàn tất khi OrchestratorInput và các lớp dữ liệu Kotlin tương tự được deserialize trong Azure mà không cần các giá trị constructor mặc định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, kotlin
Lĩnh vực
backend, cloud
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.