learnk8s / knote-java Goto Github PK
View Code? Open in Web Editor NEWSimple Spring Boot app to take notes
License: Apache License 2.0
Simple Spring Boot app to take notes
License: Apache License 2.0
com.mongodb.MongoSocketOpenException: Exception opening socket
Caused by: java.net.ConnectException: Connection refused (Connection refused)
Spring Boot recently yet again introduced a breaking change, which leads to the infamous whitelabel error page. They changed the default suffix from .ftl to .ftlh.
spring-projects/spring-boot#15131
So for Spring Boot 2.2.x applications, these extensions have to be updated.
I have been looking for an Microservice example that uses docker and kubernetes with minikube.
Working through this example I am stuck trying to run the microservice. The docker containers start up and run for mongodb and knote but the microservice always fails to connect with following exception:
Minio Reconnect: true
java.net.ConnectException: Failed to connect to localhost/127.0.0.1:9000
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:265)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183)
at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)
at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
at okhttp3.RealCall.execute(RealCall.java:81)
at io.minio.MinioClient.executeReq(MinioClient.java:1111)
at io.minio.MinioClient.execute(MinioClient.java:1070)
at io.minio.MinioClient.updateRegionCache(MinioClient.java:1219)
at io.minio.MinioClient.getRegion(MinioClient.java:1264)
at io.minio.MinioClient.executeHead(MinioClient.java:1312)
at io.minio.MinioClient.bucketExists(MinioClient.java:3286)
at io.learnk8s.demo.KNoteController.initMinio(KnoteJavaApplication.java:169)
at io.learnk8s.demo.KNoteController.init(KnoteJavaApplication.java:118)
This is probably a configuration issue on my end but I am unable to determine why this is happening and how to the resolve it. Perhaps related to localhost and a difference between 127.0.0.1 and 0.0.0.0?
My docker image is deployed:
knote-java latest ce9109e6c6df About an hour ago 393MB
Mongodb is running in a docker container:
2020-06-02T01:04:34.139+0000 I NETWORK [listener] Listening on 0.0.0.0
2020-06-02T01:04:34.139+0000 I NETWORK [listener] waiting for connections on port 27017
docker ps looks right too:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c7b4df5e8318 knote-java "/bin/sh -c 'exec ja…" 32 seconds ago Up 30 seconds 0.0.0.0:8080->8080/tcp knote-java
23d5ed2a1fc5 mongo "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 27017/tcp mongo
482ae31f5632 gcr.io/k8s-minikube/kicbase:v0.0.10 "/usr/local/bin/entr…" 6 days ago Up 4 minutes 127.0.0.1:32787->22/tcp, 127.0.0.1:32786->2376/tcp, 127.0.0.1:32785->5000/tcp, 127.0.0.1:32784->8443/tcp minikube
Any assistance is greatly appreciated. Thank you.
Reported from a student:
in the first course (java example), to make templates working i had to add
spring.freemarker.template-loader-path: classpath:/templates
spring.freemarker.suffix: .ftl
to application.properties otherwise i got 404 in the browser.
FYI @salaboy
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.