NoClassDefFoundError: com.mongodb.MongoClientSettings when importing MongoDB Hibernate dialect into demo app

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Component: MongoDB Hibernate Dialect

      Environment: Java 17, Gradle 8.x, Hibernate ORM 6.x

      Description:{}

      Attempting to run a demo application that integrates the MongoDB Hibernate Dialect results in the following runtime exception:

       

      Exception in thread "main" java.lang.NoClassDefFoundError: com/mongodb/MongoClientSettings
      at com.mongodb.hibernate.internal.cfg.MongoConfigurationBuilder.<init>(...)
      ...
      Caused by: java.lang.ClassNotFoundException: com.mongodb.MongoClientSettings
      

       

       

      Steps to Reproduce:{}

      1. Create a new Java project (demo app)
      1. Add the MongoDB Hibernate Dialect dependency
      1. Attempt to bootstrap Hibernate and build a session factory
      1. Observe the runtime failure

      Chatted with nathan.xu@mongodb.com and he resolved it with the example app by adding the mongodb-driver-sync dependency.

       

            Assignee:
            Ajay Tandon
            Reporter:
            Ajay Tandon
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: