java.lang.IllegalArgumentException: can't serialize class java.time.LocalDateTime

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Spring JIRA by Balazs Peterfi, 1 year ago
can't serialize class java.time.LocalDateTime
via Spring JIRA by Balazs Peterfi, 1 year ago
can't serialize class java.time.LocalDateTime
via Stack Overflow by pama
, 1 month ago
can't serialize class org.springframework.data.mongodb.core.query.GeoCommand
via GitHub by jyemin
, 2 years ago
can't serialize class com.....PK
via Google Groups by Johan Haleby, 5 months ago
can't serialize class com.mycompany.Entity2Id
java.lang.IllegalArgumentException: can't serialize class java.time.LocalDateTime
at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:299)
at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:194)
at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:255)
at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:194)
at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:255)
at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:194)
at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:136)
at com.mongodb.DefaultDBEncoder.writeObject(DefaultDBEncoder.java:36)
at com.mongodb.OutMessage.putObject(OutMessage.java:289)
at com.mongodb.OutMessage.writeQuery(OutMessage.java:211)
at com.mongodb.OutMessage.query(OutMessage.java:86)
at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:81)
at com.mongodb.DB.command(DB.java:320)
at com.mongodb.DB.command(DB.java:299)
at com.mongodb.DBCollection.distinct(DBCollection.java:1475)
at com.mongodb.DBCollection.distinct(DBCollection.java:1455)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 4 months ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.