diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b0700a45..c41b9b31 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,10 +14,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - name: Set up JDK 11 + uses: actions/setup-java@v3 with: - java-version: 1.8 + distribution: 'corretto' + java-version: 11 - name: Setup Android SDK uses: android-actions/setup-android@v2 diff --git a/autobahn/build.gradle b/autobahn/build.gradle index 8b375122..1a4f2982 100644 --- a/autobahn/build.gradle +++ b/autobahn/build.gradle @@ -35,6 +35,7 @@ dependencies { implementation 'org.web3j:abi:4.6.0' implementation 'org.web3j:utils:4.6.0' implementation 'org.json:json:20210307' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.3' } if (IS_NETTY) { implementation 'io.netty:netty-codec-http:4.1.63.Final' diff --git a/autobahn/src/main/java/io/crossbar/autobahn/wamp/interfaces/ISerializer.java b/autobahn/src/main/java/io/crossbar/autobahn/wamp/interfaces/ISerializer.java index 2651c140..88dd6d83 100644 --- a/autobahn/src/main/java/io/crossbar/autobahn/wamp/interfaces/ISerializer.java +++ b/autobahn/src/main/java/io/crossbar/autobahn/wamp/interfaces/ISerializer.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; @@ -32,6 +33,9 @@ public abstract class ISerializer { public ISerializer(JsonFactory factor) { mapper = new ObjectMapper(factor); + mapper.findAndRegisterModules(); + mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); + mapper.configure(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE, false); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); }