Closed
Description
This code (using version 2.17.2, 2.16.2 and 2.13.5):
ObjectMapper mapper = new JsonMapper().registerModule(new JavaTimeModule());
JsonGenerator gen = mapper.createGenerator(System.out);
gen.writeObject(new java.time.DateTimeException("dummy"));
will throw InvalidDefinitionException
with message Java 8 date/time type 'java.time.DateTimeException' not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling
which is obviously wrong as JavaTimeModule is added above.
This can be fixed in BeanUtil#checkUnsupportedType(JavaType)
by for example changing line:
if (className.indexOf('.', 10) >= 0) {
to:
if (className.indexOf('.', 10) >= 0 || className.equals("java.time.DateTimeException")) {
Metadata
Metadata
Assignees
Labels
No labels