I have created a jHipster application that uses a MongoDB database. I am trying for the last few days to deploy it on Heroku. I've run the heroku generator as required. "jhipster heroku". I also pushed the code to the heroku branch with "git push heroku master". However, I still have a problem.
Caused by:
org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.mongodb.core.MongoDbFactorySupport]: Factory method 'mongoDbFactory' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongo' defined in class path resource [org/springframework/boot/autoconfigure/mongo/MongoAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.MongoClient]: Factory method 'mongo' threw exception; nested exception is java.lang.IllegalArgumentException: The connection string is invalid. Connection strings must start with either 'mongodb://' or 'mongodb+srv://
I do realize that I have to place the MongoDB connection string, provided by the ObjectRocket addon, somewhere in the .yml files, but I am not sure where. This is not a duplicate of Deploying a JHipster/MongoDB application to Heroku because that question was asked 5 years ago and since then, Heroku provided a subgenerator for MongoDB apps on Heroku. Also, should I modify the Profile somehow?
Thanks a lot for the help!