Can't connect to MongoDB with correct credentials with Grails App

809 Views Asked by At

In my config.groovy file I am connecting to MongoDB like so

    environments {
       production {
//        db.configuration.file=System.getProperty("user.home") + "/mydb.cfg"
        grails.mongo.host = "Snip Snip"    //dataSourcesConfig.get 'host'
        grails.mongo.databaseName = 'edupal'      //dataSourcesConfig.get 'dbname'
        grails.mongo.username = 'admin'       //dataSourcesConfig.get 'user'
        grails.mongo.password = 'V********k'      //dataSourcesConfig.get 'password'
    }
    development {
        grails.mongo.databaseName = 'edupal'
    }
}

when I deploy my .war file the page appears blank because I am getting this error in my TOMCAT log. I am 110% certain the password and username that I use are correct. When I go to RockMongo and login, I copy and paste. I can run the app perfectly off my local machine.

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'mongoTransactionManager' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTransactionManager': Cannot resolve reference to bean 'mongoDatastore' while setting bean property 'datastore'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mongodb.CannotGetMongoDbConnectionException: Failed to authenticate to database [edupal], username = [admin], password = [V********k] ... 5 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTransactionManager': Cannot resolve reference to bean 'mongoDatastore' while setting bean property 'datastore'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mongodb.CannotGetMongoDbConnectionException: Failed to authenticate to database [edupal], username = [admin], password = [V********k] ... 5 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mongodb.CannotGetMongoDbConnectionException: Failed to authenticate to database [edupal], username = [admin], password = [V********k] ... 5 more Caused by: org.springframework.data.mongodb.CannotGetMongoDbConnectionException: Failed to authenticate to database [edupal], username = [admin], password = [V********k] at org.grails.datastore.mapping.mongo.MongoDatastore.initializeIndices(MongoDatastore.java:285) at org.grails.datastore.mapping.mongo.MongoDatastore.createMongoTemplate(MongoDatastore.java:276) at org.grails.datastore.mapping.mongo.MongoDatastore.afterPropertiesSet(MongoDatastore.java:221) at org.grails.datastore.gorm.mongo.bean.factory.MongoDatastoreFactoryBean.getObject(MongoDatastoreFactoryBean.groovy:54) ... 5 more

0

There are 0 best solutions below