Unable to launch spring boot for M220J first ticket

Hey, I keep getting an error whenever I try to launch the spring boot application from the M220J course. I’ve downloaded the course material multiple times and triple checked that I’ve followed the instructions correctly. Hopefully this error log can tell someone out there what I did wrong, and thanks in advance for the help!

`[INFO] -----------------------------------------------------------

[INFO] BUILD FAILURE
[INFO] -----------------------------------------------------------

[INFO] Total time: 10.867 s
[INFO] Finished at: 2021-03-05T14:02:41-06:00
[INFO] -----------------------------------------------------------

[ERROR] Failed to execute goal org.springframework.boot:spring-bo
ot-maven-plugin:2.0.3.RELEASE:run (default-cli) on project mflix
: An exception occurred while running. null: InvocationTargetExcepti
on: Error creating bean with name ‘movieController’: Unsatisfied dependency expr
essed through field ‘moviesService’; nested exception is org.springframework.bea
ns.factory.UnsatisfiedDependencyException: Error creating bean with name ‘movies
Service’: Unsatisfied dependency expressed through field ‘movieDao’; nested exce
ption is org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name ‘movieDao’ defined in file [C:\Users\Mike\Downloads\mfl
ix-java\mflix\target\classes\mflix\api\daos\MovieDao.class]: Unsatisfied depende
ncy expressed through constructor parameter 0; nested exception is org.springfra
mework.beans.factory.BeanCreationException: Error creating bean with name ‘mongo
Client’ defined in class path resource [mflix/config/MongoDBConfiguration.class]
: Bean instantiation via factory method failed; nested exception is org.springfr
amework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.cli
ent.MongoClient]: Factory method ‘mongoClient’ threw exception; nested exception
is java.lang.IllegalArgumentException: A connection string using the mongodb+sr
v protocol can notcontain a host name that specifies a port -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with t
he -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug l
ogging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAV
EN/MojoExecutionException`

1 Like

Hi,

Fix your “spring.mongodb.uri” proprety in “application.properties” file

good luck

Thank you so much! I was using the wrong format to connect to my cluster. It works perfectly now.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.