Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with DateTimeFormatter not serializable #135

Open
joaomoraski opened this issue Dec 21, 2023 · 0 comments
Open

Problem with DateTimeFormatter not serializable #135

joaomoraski opened this issue Dec 21, 2023 · 0 comments

Comments

@joaomoraski
Copy link

I am trying to implement Hazelcast for session replication in version 5.3.2 on Tomcat.

When I run my system, at the time of retrieving the session, it returns an error saying that it was not possible to serialize the DateTimeFormatter. I tried changing the class variable to a function or something similar in various places, but nothing had any effect.

After researching a bit, I found out that DateTimeFormatter is not serializable by Java's own decision. So, I would like to know if anyone has had a similar issue or if there is a known solution to address this problem.

Caused by: java.io.NotSerializableException: java.time.format.DateTimeFormatter
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at java.util.HashMap.internalWriteEntries(HashMap.java:1817)
	at java.util.HashMap.writeObject(HashMap.java:1364)
	at sun.reflect.GeneratedMethodAccessor264.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant