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

GitHub | srikanthvejendla | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded 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