Jackson deserialization issue with Kotlin and data classes

Aberta
#270 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
42/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
java, kotlin
Domínio
backend, cloud

Direção de pesquisa

Comece com build.gradle.kts e compare a configuração de dependências usada com o Azurite com a usada no Azure. Rastreie como o durable task data converter é configurado para cargas de trabalho Kotlin implantadas; considera-se concluído quando OrchestratorInput e classes de dados Kotlin semelhantes são desserializadas no Azure sem valores padrão do construtor.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Needs: Triage :mag:

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.

Linguagem predominante
Java
Estrelas
29
Forks
18
Merge médio
1d 10h
PRs com merge (30d)
2

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de microsoft/durabletask-java

Todas as issues de microsoft/durabletask-java

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.