java.lang.ClassCastException

org.bson.Document cannot be cast to org.bson.conversions.Bson

Samebug tips0

We couldn't find tips for this exception.

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

Solutions on the web1

Stack trace

  • java.lang.ClassCastException: org.bson.Document cannot be cast to org.bson.conversions.Bson at com.mongodb.FindIterableImpl.<init>(FindIterableImpl.java:57) at com.mongodb.MongoCollectionImpl.find(MongoCollectionImpl.java:216) at com.mongodb.MongoCollectionImpl.find(MongoCollectionImpl.java:211) at com.relevantcodes.extentreports.reporter.ExtentXReporter.setupProject(ExtentXReporter.java:193) at com.relevantcodes.extentreports.reporter.ExtentXReporter.start(ExtentXReporter.java:161) at com.relevantcodes.extentreports.Report.attach(Report.java:38) at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at com.relevantcodes.extentreports.ExtentReports.attachReporter(ExtentReports.java:11) at com.samsclub.qa.android.tests.SampleTest.firstTest(SampleTest.java:40)

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

We couldn't find other users who have seen this exception.