java.lang.IllegalArgumentException

can't serialize class entities.users.NormalUser

Samebug tips1

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

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web5160

  • can't serialize class entities.users.NormalUser
  • via Stack Overflow by stack man
    , 10 months ago
    can't serialize class entities.users.NormalUser
  • via GitHub by TimeIsGoOn
    , 8 months ago
    can't serialize class java.math.BigDecimal
  • Stack trace

    • 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) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Once, 1 month ago
    Once, 1 month ago
    2 times, 3 months ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    5 more bugmates