java.lang.IllegalArgumentException: can't serialize class entities.users.NormalUser

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

,

This happened when I tried to insert an empty list of elements to a MongoDB collection.

,
via JIRA by Stephan Schroevers

You try to insert an empty list into MongoDB before 3.5.0 .

Check that the inserted list is not empty or upgrade your server.

Solutions on the web

via Stack Overflow by stack man
, 1 year ago
can't serialize class entities.users.NormalUser
via Stack Overflow by stack man
, 1 year ago
via Stack Overflow by user1757928
, 2 years ago
via Stack Overflow by popcoder
, 2 years ago
can't serialize class twitter4j.internal.json.UserJSONImpl
via Stack Overflow by nazar_art
, 2 years ago
can't serialize class com.aerlingus.ta.data.dao.b2b.Test
via apache.org by Unknown author, 1 year ago
can't serialize class org.apache.logging.log4j.Level
java.lang.IllegalArgumentException: can't serialize class entities.users.NormalUser
at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:270)
at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:174)
at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:120)
at com.mongodb.DefaultDBEncoder.writeObject(DefaultDBEncoder.java:27)
at com.mongodb.OutMessage.putObject(OutMessage.java:289)
at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:261)
at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:226)
at com.mongodb.DBCollection.insert(DBCollection.java:75)
at com.mongodb.DBCollection.insert(DBCollection.java:59)
at com.mongodb.DBCollection.insert(DBCollection.java:104)
at repositories.UsersRepository.createUser(UsersRepository.java:35)
at repositories.UsersRepository.main(UsersRepository.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)

Users with the same issue

Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 6 months ago
Samebug visitor profile picture
Unknown user
Once, 2 years 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.