Cannot run project

I cannot run the mflix project.

Console giving error message : Process finished with exit code 1.

full error:
Caused by: java.lang.IllegalArgumentException: An SRV host name ‘YOUR_CLUSTER_URI’ was provided that does not contain at least three parts. It must contain a hostname, domain name and a top level domain.
at com.mongodb.internal.dns.DnsResolver.resolveHostFromSrvRecords(DnsResolver.java:52) ~[mongodb-driver-core-3.9.1.jar:na]
at com.mongodb.ConnectionString.(ConnectionString.java:325) ~[mongodb-driver-core-3.9.1.jar:na]
at mflix.config.MongoDBConfiguration.mongoClient(MongoDBConfiguration.java:25) ~[classes/:na]
at mflix.config.MongoDBConfiguration$$EnhancerBySpringCGLIB$$55653200.CGLIB$mongoClient$0() ~[classes/:na]
at mflix.config.MongoDBConfiguration$$EnhancerBySpringCGLIB$$55653200$$FastClassBySpringCGLIB$$2b33cfd3.invoke() ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at mflix.config.MongoDBConfiguration$$EnhancerBySpringCGLIB$$55653200.mongoClient() ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
… 59 common frames omitted

Process finished with exit code 1

I am having exactly the same issue.

hope someone will help to resolve. i tried multiple times from all Ide including inelij

Hi David , I got the issue. Actually before running the application. you have to edit application.properties located in resource folder.
just change value of field - spring.mongodb.uri= your Srv string.
if you still get error let me know.
let me know if issue is resolved. Happy learning.

1 Like

Hi Rashu, It works perfectly now. Thanks a lot. Best of luck.