나름 찬찬히 따라가고 있었는데 테스트 코드를 실행하자마자 오류가 발생했다.
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
데이터 소스를 찾는 데에 실패했다 .. 라고 하는데 ..
강의를 따라가다가 코드를 놓쳤나 ? 싶어서 보니 .yml
파일을 만드는 것을 놓쳐버렸다 ! .. ㅎㅎ
그래서 바로 파일을 만들어주었다.
파일을 만들고, 필요한 코드를 적어준 다음에 실행했더니 이번에는 다른 오류가 발생했다.
org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:319) ~[postgresql-42.5.1.jar:42.5.1]
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.5.1.jar:42.5.1]
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:247) ~[postgresql-42.5.1.jar:42.5.1]
localhost:5432에 연결하는 것이 거절되었다 .. 라고 한다.
익숙한 포트 번호에 생각해보니, Docker에 연결할 수 없다는 것이었다 !
아니,, Docker에 DB를 연결해놓고 Docker를 실행을 하지 않은 채로 실행을 했다.
뭐 이런 .. 바보같은 경우가 다 .. ^^
Docker를 열고, DB를 실행해준 후에 다시 파일을 실행해보니 잘 동작했다 !