Spring Boot + Mysql + Docker: Connection refused
2024-08-01 11:43:09 tandt | java.lang.NullPointerException: Cannot invoke “org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(java.sql.SQLException, String)” because the return value of “org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.sqlExceptionHelper()” is null
2024-08-01 11:43:09 tandt | at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(JdbcIsolationDelegate.java:116) ~[hibernate-core-6.4.4.Final.jar!/:6.4.4.Final]
…
2024-08-01 11:43:12 tandt | Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
2024-08-01 11:43:12 tandt |
2024-08-01 11:43:12 tandt | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
…
2024-08-01 11:43:12 tandt | Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
2024-08-01 11:43:12 tandt |
2024-08-01 11:43:12 tandt | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
…
2024-08-01 11:43:12 tandt | Caused by: java.net.ConnectException: Connection refused
2024-08-01 11:43:12 tandt | at java.base/sun.nio.ch.Net.connect0(Native Method) ~[na:na]
2024-08-01 11:43:12 tandt | at java.base/sun.nio.ch.Net.connect(Net.java:589) ~[na:na]
2024-08-01 11:43:12 tandt | at java.base/sun.nio.ch.Net.connect(Net.java:578) ~[na:na]
2024-08-01 11:43:12 tandt | at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:583) ~[na:na]
Spring Boot and Mysql, Docker Connection refused
2024-08-01 11:07:42 tandt | java.lang.NullPointerException: Cannot invoke “org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(java.sql.SQLException, String)” because the return value of “org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.sqlExceptionHelper()” is null
…
2024-08-01 11:07:43 tandt | 2024-08-01T04:07:43.697Z ERROR 1 — [tandtrest] [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : Communications link failure
2024-08-01 11:07:43 tandt |
2024-08-01 11:07:43 tandt | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
2024-08-01 11:07:43 tandt | 2024-08-01T04:07:43.706Z ERROR 1 — [tandtrest] [ main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection for DDL execution [Communications link failure
2024-08-01 11:07:43 tandt |
2024-08-01 11:07:43 tandt | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.] [n/a]
2024-08-01 11:07:43 tandt | 2024-08-01T04:07:43.708Z ERROR 1 — [tandtrest] [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name ‘jwtAuthenticationFilter’ defined in URL [jar:nested:/app/tandtrest-1.0.0.jar/!BOOT-INF/classes/!/t4sev2/tandtrest/config/JwtAuthenticationFilter.class]: Unsatisfied dependency expressed through constructor parameter 1: Error creating bean with name ‘appConfig’ defined in URL [jar:nested:/app/tandtrest-1.0.0.jar/!BOOT-INF/classes/!/t4sev2/tandtrest/config/AppConfig.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name ‘userRepository’ defined in t4sev2.tandtrest.repo.UserRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Cannot resolve reference to bean ‘jpaSharedEM_entityManagerFactory’ while setting bean property ‘entityManager’
2024-08-01 11:07:43 tandt | 2024-08-01T04:07:43.737Z INFO 1 — [tandtrest] [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2024-08-01 11:07:43 tandt | 2024-08-01T04:07:43.742Z WARN 1 — [tandtrest] [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization – cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server
2024-08-01 11:07:43 tandt | 2024-08-01T04:07:43.755Z INFO 1 — [tandtrest] [ main] .s.b.a.l.ConditionEvaluationReportLogger :
2024-08-01 11:07:43 tandt |
2024-08-01 11:07:43 tandt | Error starting ApplicationContext. To display the condition evaluation report re-run your application with ‘debug’ enabled.
2024-08-01 11:07:43 tandt | 2024-08-01T04:07:43.775Z ERROR 1 — [tandtrest] [ main] o.s.boot.SpringApplication : Application run failed
2024-08-01 11:07:43 tandt |
2024-08-01 11:07:43 tandt | org.springframework.context.ApplicationContextException: Unable to start web server
2024-08-01 11:07:43 tandt | at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:165) ~[spring-boot-3.2.5.jar!/:3.2.5]
2024-08-01 11:07:43 tandt | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:618) ~[spring-context-6.1.6.jar!/:6.1.6]
2024-08-01 11:07:43 tandt | at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.5.jar!/:3.2.5]
2024-08-01 11:07:43 tandt | at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.5.jar!/:3.2.5]
2024-08-01 11:07:43 tandt | at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.5.jar!/:3.2.5]
2024-08-01 11:07:43 tandt | at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.5.jar!/:3.2.5]
2024-08-01 11:07:43 tandt | at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar!/:3.2.5]
2024-08-01 11:07:43 tandt | at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar!/:3.2.5]
…
2024-08-01 11:07:43 tandt | Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
…
2024-08-01 11:07:43 tandt | at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:805) ~[mysql-connector-j-8.3.0.jar!/:8.3.0]
2024-08-01 11:07:43 tandt | … 152 common frames omitted
2024-08-01 11:07:43 tandt | Caused by: java.net.ConnectException: Connection refused
2024-08-01 11:07:43 tandt | at java.base/sun.nio.ch.Net.connect0(Native Method) ~[na:na]
2024-08-01 11:07:43 tandt | at java.base/sun.nio.ch.Net.connect(Net.java:589) ~[na:na]
2024-08-01 11:07:43 tandt | at java.base/sun.nio.ch.Net.connect(Net.java:578) ~[na:na]
2024-08-01 11:07:43 tandt | at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:583) ~[na:na]
2024-08-01 11:07:43 tandt | at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[na:na]
2024-08-01 11:07:43 tandt | at java.base/java.net.Socket.connect(Socket.java:751) ~[na:na]
2024-08-01 11:07:43 tandt | at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:153) ~[mysql-connector-j-8.3.0.jar!/:8.3.0]
2024-08-01 11:07:43 tandt | at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:62) ~[mysql-connector-j-8.3.0.jar!/:8.3.0]
2024-08-01 11:07:43 tandt | … 155 common frames omitted
2024-08-01 11:07:43 tandt |
1970-01-01 07:00:00 tandt exited with code 1
fail to connect to host when attempting to spin up metabase using mysql database in docker
I am trying to spin up a simple stack in my github codespace instance. I have a simple docker-compose.yml
that looks like the following.
Can’t connect to a mySQL Docker server from Sprint Boot app
I’m trying out a few new things right now, and I wanted to create a small Spring/mySQL application. I’ve set up a docker-compose file as the following: