[
https://issues.apache.org/jira/browse/GEODE-8256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18069636#comment-18069636
]
Yuwei Chang commented on GEODE-8256:
------------------------------------
I implemented a minimal fix for GEODE-8256 by updating the ObjectMapper used in
PdxInstanceImpl#getObject() to register Jackson’s Jdk8Module and
JavaTimeModule. This allows typed JSON containing Java 8 types such as Optional
and LocalDate to deserialize correctly. Please take a look when you have a
chance. Thank you. https://github.com/apache/geode/pull/7998
> The Jackson ObjectMapper used by a PdxInstance does not properly handle Java
> 8 Types
> ------------------------------------------------------------------------------------
>
> Key: GEODE-8256
> URL: https://issues.apache.org/jira/browse/GEODE-8256
> Project: Geode
> Issue Type: Bug
> Components: serialization
> Affects Versions: 1.9.2, 1.10.0, 1.11.0, 1.12.0
> Reporter: John Blum
> Priority: Blocker
> Labels: JSON-PDX
>
> The Jackson {{ObjectMapper}} in the {{PdxInstanceImpl}} class (see
> [here|https://github.com/apache/geode/blob/rel/v1.12.0/geode-core/src/main/java/org/apache/geode/pdx/internal/PdxInstanceImpl.java#L68-L75])is
> not properly configured.
> Specifically, it cannot handle *Java 8* types since these types are not
> included in Jackson 2, by default, primarily because Jackson 2 is based on
> Java 6 (not Java 8). However, that does not mean Jackson 2 cannot handle
> Java 8 types, when configured properly with extension modules.
> To make matters worse, the {{ObjectMapper}} used by PDX, and specifically the
> {{PdxInstance}} implementation, violates the _Open/Closed_ software design
> principle, so there is literally no way to modify (i.e. override/extend) the
> configuration of the {{ObjectMapper}} as required by the application.
> See
> [here|https://github.com/spring-projects/spring-boot-data-geode/blob/1.3.0.RELEASE/spring-geode/src/test/java/org/springframework/geode/data/json/JsonCacheDataImporterExporterIntegrationTests.java#L583-L618]
> for a test case demonstrating the issue.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)