java.lang.ClassCastException: org.bson.Document cannot be cast to org.bson.conversions.Bson

GitHub | srikanthvejendla | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.

Root Cause Analysis

  1. java.lang.ClassCastException

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

    at com.mongodb.FindIterableImpl.<init>()
  2. MongoDB Java Driver
    MongoCollectionImpl.find
    1. com.mongodb.FindIterableImpl.<init>(FindIterableImpl.java:57)
    2. com.mongodb.MongoCollectionImpl.find(MongoCollectionImpl.java:216)
    3. com.mongodb.MongoCollectionImpl.find(MongoCollectionImpl.java:211)
    3 frames
  3. com.relevantcodes.extentreports
    Report.attach
    1. com.relevantcodes.extentreports.reporter.ExtentXReporter.setupProject(ExtentXReporter.java:193)
    2. com.relevantcodes.extentreports.reporter.ExtentXReporter.start(ExtentXReporter.java:161)
    3. com.relevantcodes.extentreports.Report.attach(Report.java:38)
    3 frames
  4. Java RT
    ReferencePipeline$Head.forEach
    1. java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
    2. java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    2 frames
  5. com.relevantcodes.extentreports
    ExtentReports.attachReporter
    1. com.relevantcodes.extentreports.ExtentReports.attachReporter(ExtentReports.java:11)
    1 frame
  6. com.samsclub.qa
    SampleTest.firstTest
    1. com.samsclub.qa.android.tests.SampleTest.firstTest(SampleTest.java:40)
    1 frame