You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using latest version for GSON manually: implementation("com.google.code.gson:gson:2.10.1")
System:
openjdk version "17.0.7" 2023-04-18 LTS
OpenJDK Runtime Environment Corretto-17.0.7.7.1 (build 17.0.7+7-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.7.7.1 (build 17.0.7+7-LTS, mixed mode, sharing)
Intellij
java.lang.reflect.InaccessibleObjectException: Unable to make field private final long java.time.Instant.seconds accessible: module java.base does not "opens java.time" to unnamed module @2d3379b4 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178) at java.base/java.lang.reflect.Field.setAccessible(Field.java:172) at com.google.gson.internal.reflect.ReflectionHelper.makeAccessible(ReflectionHelper.java:35) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:286) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:294) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:294) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:294) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:294) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:294) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.Gson.toJson(Gson.java:834) at com.google.gson.Gson.toJson(Gson.java:812) at com.google.gson.Gson.toJson(Gson.java:759) at com.google.gson.Gson.toJson(Gson.java:736) at com.pusher.rest.marshaller.DefaultDataMarshaller.marshal(DefaultDataMarshaller.java:22) at com.pusher.rest.PusherAbstract.serialise(PusherAbstract.java:226) at com.pusher.rest.PusherAbstract.trigger(PusherAbstract.java:301) at com.pusher.rest.PusherAbstract.trigger(PusherAbstract.java:273) at com.pusher.rest.PusherAbstract.trigger(PusherAbstract.java:248) at myservice.MyClass.trigger(MyClass.java:37)
The text was updated successfully, but these errors were encountered:
I have done some research and it seems that when using Gson pusher would need to add a custom adapter for serializing any objects that has a date field.
I have been trying to run Pusher http java on Java 17 and it is failing due to one of the dependencies.
Tried excluding the GSON from google no success:
implementation("com.pusher:pusher-http-java:1.3.3") { exclude group: "com.google.code.gson" }
Using latest version for GSON manually:
implementation("com.google.code.gson:gson:2.10.1")
System:
openjdk version "17.0.7" 2023-04-18 LTS
OpenJDK Runtime Environment Corretto-17.0.7.7.1 (build 17.0.7+7-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.7.7.1 (build 17.0.7+7-LTS, mixed mode, sharing)
Intellij
java.lang.reflect.InaccessibleObjectException: Unable to make field private final long java.time.Instant.seconds accessible: module java.base does not "opens java.time" to unnamed module @2d3379b4 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178) at java.base/java.lang.reflect.Field.setAccessible(Field.java:172) at com.google.gson.internal.reflect.ReflectionHelper.makeAccessible(ReflectionHelper.java:35) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:286) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:294) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:294) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:294) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:294) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:294) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130) at com.google.gson.Gson.getAdapter(Gson.java:556) at com.google.gson.Gson.toJson(Gson.java:834) at com.google.gson.Gson.toJson(Gson.java:812) at com.google.gson.Gson.toJson(Gson.java:759) at com.google.gson.Gson.toJson(Gson.java:736) at com.pusher.rest.marshaller.DefaultDataMarshaller.marshal(DefaultDataMarshaller.java:22) at com.pusher.rest.PusherAbstract.serialise(PusherAbstract.java:226) at com.pusher.rest.PusherAbstract.trigger(PusherAbstract.java:301) at com.pusher.rest.PusherAbstract.trigger(PusherAbstract.java:273) at com.pusher.rest.PusherAbstract.trigger(PusherAbstract.java:248) at myservice.MyClass.trigger(MyClass.java:37)
The text was updated successfully, but these errors were encountered: