quarkus: Yasson is unable to deserialize an Optional in native

Describe the bug Yasson is unable to deserialize a POJO with an Optional<String> attribute in native mode. There is no issue in JVM mode.

There is no stacktrace, only the following SEVER log:

2020-07-15 15:15:49,462 SEVERE [org.ecl.yas.int.Unmarshaller] (executor-thread-1) Unable to deserialize property 'optionalString' because of: Cannot create instance of a class: class java.lang.String, No default constructor found.

Expected behavior Deserializing an Optional<String> works in both native and JVM mode.

To Reproduce Running the mongodb-client integration test from the following branch: https://github.com/loicmathieu/quarkus/tree/mongodb/property-codec-provider/integration-tests/mongodb-client

Environment (please complete the following information):

  • Output of uname -a or ver: Linux 5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Output of java -version: openjdk version “11.0.7” 2020-04-14
  • GraalVM version (if different from Java): GraalVM Version 20.1.0 (Java Version 11.0.7)
  • Quarkus version or git rev: current master

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 24 (24 by maintainers)

Commits related to this issue

Most upvoted comments

OK, I’ll give it a try

OK, I think I understand what you means now 😉 I’ll have a look next week …