spring-cloud-netflix
spring-cloud-netflix copied to clipboard
Docker compose Connection Refused and Hibernate dialect not set issue.
Hi, I'm trying to implement an example of Spring Boot Microservices. Here is my github link : Link I have a problem in my docker-compose.yml.
Only keycloak, mysql, config server and lastly rabbitmq works properly while other service cannot work flawlessly.
Eureka server throws the issue shown below.
Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eu
reka/}, exception=java.net.ConnectException: Connection refused (Connection refused) stacktrace=com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection
refused (Connection refused)
DiscoveryClient_DISCOVERY-SERVER/3907042bce2d:discovery-server - was unable to refresh
its cache! This periodic background refresh will be retried in 30 seconds. status = Cannot execute request on any known server stacktrace = com.netflix.discovery.shared.transport.Trans
portException: Cannot execute request on any known server
Api gateway throws the issue shown below.
Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eu
reka/}, exception=I/O error on GET request for "http://localhost:8761/eureka/apps/": Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refused (Connection refused); ne
sted exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refused (Connection refused) stacktrace=org.springfr
amework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8761/eureka/apps/": Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refuse
d (Connection refused); nested exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refused (Connection refuse
d)
DiscoveryClient_API-GATEWAY/132554e5eb54:api-gateway:8600 - was unable to refresh its c
ache! This periodic background refresh will be retried in 30 seconds. status = Cannot execute request on any known server stacktrace = com.netflix.discovery.shared.transport.TransportE
xception: Cannot execute request on any known server
Management Service throws an issue shown below.
Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eu
reka/}, exception=I/O error on GET request for "http://localhost:8761/eureka/apps/": Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refused (Connection refused); ne
sted exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refused (Connection refused) stacktrace=org.springfr
amework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8761/eureka/apps/": Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refuse
d (Connection refused); nested exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refused (Connection refuse
d)
DiscoveryClient_MANAGEMENT-SERVICE/d72fcbc216eb:management-service:9002 - was unable to
refresh its cache! This periodic background refresh will be retried in 30 seconds. status = Cannot execute request on any known server stacktrace = com.netflix.discovery.shared.transp
ort.TransportException: Cannot execute request on any known server
User service throws an issue shown below.
Failed to create instance of driver class org.hibernate.dialect.MySQL8Dialect, trying j
dbcUrl resolution
java.lang.ClassCastException: class org.hibernate.dialect.MySQL8Dialect cannot be cast to class java.sql.Driver (org.hibernate.dialect.MySQL8Dialect is in unnamed module of loader org.
springframework.boot.loader.LaunchedURLClassLoader @2096442d; java.sql.Driver is in module java.sql of loader 'platform')
org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
It seems like the issue is in your docker setup, not a bug in any of the libraries, so, unfortunately, we will not be able to help. You should probably start with fixing up your DB setup.