java.lang.IllegalArgumentException: can't serialize class java.math.BigInteger

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 JIRA by Gina Chen, 1 year ago
can't serialize class java.math.BigInteger
via GitHub by TimeIsGoOn
, 1 year ago
can't serialize class java.math.BigDecimal
java.lang.IllegalArgumentException: can't serialize class java.math.BigInteger
at org.bson.BasicBSONEncoder.putNumber(BasicBSONEncoder.java:373)
at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:218)
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:267)
at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:240)
at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:205)
at com.mongodb.DBCollection.insert(DBCollection.java:57)
at com.mongodb.DBCollection.insert(DBCollection.java:100)
at com.dreamworks.pam.logging.dao.mongodb.LogEntryDAOImpl.createLogEntry(LogEntryDAOImpl.java:88)
at com.dreamworks.pam.logging.services.impl.LogEntryServiceImpl.createLogEntry(LogEntryServiceImpl.java:85)
at com.dreamworks.pam.logging.services.jms.LogEntryMessageListener.onMessage(LogEntryMessageListener.java:67)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:326)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:264)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1071)
at java.lang.Thread.run(Thread.java:619)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 years ago
Once, 1 year ago
3 times, 1 month ago
Once, 1 month ago
Once, 1 month ago
3 more bugmates

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