#Error:An SRV host name '`${MONGO_CLUSTER}`' was provided that does not contain at least three parts.
1 messages · Page 1 of 1 (latest)
<@&987246527741304832> please have a look, thanks.
Why do you have backticks around your cluster?
I've already tried it without the change, but it didn't work. People in the comments on the YouTube course I watched suggested to put so
Is there any mistake i made while connecting MongoDB?
Which Spring version are you using by the way? Nowadays it's MONGO_USER and not env.and not env.MONGO_USER
SpringBoot 3.3.4
still the same
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongo' defined in class path resource [org/springframework/boot/autoconfigure/mongo/MongoAutoConfiguration.class]: Failed to instantiate [com.mongodb.client.MongoClient]: Factory method 'mongo' threw exception with message: An SRV host name '${MONGO_CLUSTER}' was provided that does not contain at least three parts. It must contain a hostname, domain name and a top level domain.
And are you actually defining those?
I suppose my CLUSTER is wrong
As you can see here, I defined ig
Btw This is my first time working with springboot
I don't see spring.config.import=optional:file:.env[.properties], so did the guide tell you to use something like spring-dotenv?
Please use a recent version, we're at 4.0.0.
Thanks bro,It works pretty well!
Glad to hear that. There were some changes between 2 and 4.