inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]

45강 dev 연결 에러

362

작성자 없음

작성한 질문수 0

0

java -jar build/libs/library-app-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev

 

2024-03-06 06:57:53.124 ERROR 3375 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-j-8.0.31.jar!/:8.0.31]

at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-j-8.0.31.jar!/:8.0.31]

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:828) ~[mysql-connector-j-8.0.31.jar!/:8.0.31]

at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:448) ~[mysql-connector-j-8.0.31.jar!/:8.0.31]

at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241) ~[mysql-connector-j-8.0.31.jar!/:8.0.31]

at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[mysql-connector-j-8.0.31.jar!/:8.0.31]

2024-03-06 06:34:35.506 WARN 24251 --- [ main] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain connection to query metadata

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

2024-03-06 06:57:53.140 ERROR 3375 --- [ main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

2024-03-06 06:57:53.140 WARN 3375 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

2024-03-06 06:57:53.152 INFO 3375 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]

2024-03-06 06:57:53.185 INFO 3375 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2024-03-06 06:57:53.233 ERROR 3375 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

 

 

 

 

제 컴퓨터 mysql로 연결되어서 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure 이런 에러가 나온 것 같은데 AWS에서 빌린 컴퓨터에서 mysql연결하려면 어떻게 해야하나요?

아니면 제 컴퓨터 mysql로 연결하고 진행하나요?

java spring aws mysql spring-boot jpa

답변 1

0

최태현

안녕하세요! alien22님! 🙂

질문 주셔서 감사합니다.

 

보다 정확한 것은 application.yml 설정을 확인해 보아야 알 수 있을 것 같은데요!

우선 AWS에서는 AWS에 설치되어 있는 DB에 연결하는 것이 맞아요! 그래서 profile 이란 것을 활용해 각자의 컴퓨터 (local 환경) 과 AWS 컴퓨터에서 각각 다른 DB에 접근할 수 있도록 하는것이고요! 👍

AWS에서 우리컴퓨터로 연결하는 경우는 거의 없습니다! (반대로 우리 컴퓨터에서 AWS로 연결하는 경우는 꽤 있어요)

 

설정이 잘 되어 있는지 application.yml 을 확인해보시고, AWS에서도 DB가 잘 켜져 있는지 확인해보시면 될 것 같습니다.

답변이 도움이 되었으면 좋겠습니다. 감사합니다! 🙏

패키지 구분에 대해 궁금한게 있습니다

0

20

2

리액트 관련 질문이 있습니다.

0

64

2

스프링부트 버전

0

74

2

7강 강의를 들으려고 했는데 오류가 나서 서버가 안 켜지는거 같아요.

0

59

2

33강. UserLoanHistory의 관계성에 대한 질문

1

56

2

Java JDK 버전 문의의 건

0

134

2

ec2 에서 Linux버전이 달라져서 설치가 안되는것 같은데 자료 최신화좀 해주세요.

0

89

3

h2 console 접속했을 테이블 질문

1

65

1

ec2 서버에서 스프링 실행도 되고 인바운드 설정까지 했는데 index.html 안됨

0

78

2

15강. updateUser() 질문

0

55

2

깃허브 질

0

82

2

여기까지 다 끝냈다고 하셨는데

0

79

2

왜안될까요

0

70

2

MySQL 창이안ㄴ뜹니다

0

59

2

포스트맨

0

50

1

spring 개념적인 질문

0

71

2

인텔리제이 샘플코드 실행 안됨 오류

0

140

2

aws 배포할때 .env 파일에 저장한 환경변수에 관하여 여쭤볼게 있습니다

0

85

1

마이그레이션 오류입니다.

0

171

3

Whitelabel Error Page 오류가 났습니다.

0

164

2

안녕하십니까! 오류가 났습니다.. 도와주세요 ㅜㅜ

1

93

3

궁금한게 있습니다.

0

60

2

DTO 관련

0

70

2

궁금한게 있습니다!

0

69

2