knote-java icon indicating copy to clipboard operation
knote-java copied to clipboard

mongodb ConnectException: in mac with branch 2 (dockerization example)

Open srinivasbellarichenna opened this issue 3 years ago • 2 comments

com.mongodb.MongoSocketOpenException: Exception opening socket Caused by: java.net.ConnectException: Connection refused (Connection refused)

srinivasbellarichenna avatar Jul 11 '21 20:07 srinivasbellarichenna

@srinivasbellarichenna did you by any chance get this working?

sirAlexander avatar Jul 22 '21 20:07 sirAlexander

@srinivasbellarichenna I figured it out. One needs to update their applications.properties file to use EnVars i.e. spring.data.mongodb.uri=${MONGO_URL:mongodb://localhost:27017/dev}

You then need to:

  1. do a new maven clean and install
  2. re build the knote-java docker image again. Use the no cache flag i.e. docker build --no-cache -t knote-java .

Hopefully this should fix your issue. If so please feel free to close this issue :)

sirAlexander avatar Jul 22 '21 20:07 sirAlexander