2022. 11. 30. 23:34ใBack-End ์์ ์ค/Spring Framework
"์ด ํฌ์คํ ์ ์ฟ ํก ํํธ๋์ค ํ๋์ ์ผํ์ผ๋ก, ์ด์ ๋ฐ๋ฅธ ์ผ์ ์ก์ ์์๋ฃ๋ฅผ ์ ๊ณต๋ฐ์ต๋๋ค."
๐ ๋ชฉ์ฐจ
โ [Infra] Maria DB(MySQL) ์ด์คํ(Replication) ๋จ๋ฐฉํฅ ๊ตฌ์ฑ
โ [Spring Boot][MariaDB] ์ด์คํ๋ Data Base ์ด๊ธฐ ๊ตฌ์ฑ
๐ ๋จ๋ฐฉํฅ ์ด์คํ๋ Maria DB Spring Boot์์ ๊ฐ์ง๊ณ ๋๊ธฐ
๐ฝ ๊ฐ์
๐ฆ ์ค๋ช
์ด ์ ์ ๊ตฌ์ฑํ๋ ๊ฐ๋ฐ ํ๊ฒฝ Maria DB๋ฅผ ๋จ๋ฐฉํฅ ์ด์คํ ์ฒ๋ฆฌ๋ฅผ ํ๊ณ , ์ ์ ์๋ํ๋ ๊ฒ๊น์ง ํ์ธํ์์ด์.
์ด์ ๊ตฌ์ฑ์ ์๋ฃํ์ผ๋ ๋ณธ๊ฒฉ์ ์ผ๋ก ์ฌ์ฉํ๊ธฐ ์ํด ์ค์ ํ๊ณ ๊ฐ์ง๊ณ ๋์๋ณด๋ ค๊ณ ํด์. ๐
Data Base๋ฅผ ๊ตฌ์ฑํ๊ณ , WEB, WAS ๋ฑ์ ๊ตฌ์ฑํ๊ณ , Service๋ฅผ Openํ๊ฒ ๋๋ฉด ์ด์ฉ์๋ค์ ์ฐ๋ ํ์ ์ฆ, Write ๋ณด๋ค ์ฝ๋ ํ์ ์ฆ, Read ํ์๋ฅผ ๋ ๋ง์ด ํ๊ฒ ๋ฉ๋๋ค.
ํ์
์์ Data Base ๋ถํ๋ฅผ ๋ถ์ฐํ๊ธฐ ์ํด ์์ ๊ฐ์ด Master - Slave ํน์ Master - Master ํ์์ผ๋ก ์ด์คํ๋ฅผ ํ๊ณ ์์ด์.
์ด๋ฌํ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ง๊ณ ์์ ๋, Transection์ ์์ฑ์ด readOnly = true์ผ ๊ฒฝ์ฐ Slave Data Base์ Select Query๋ฅผ ๋์ง๊ฒ ์ค์ ํด์ค์ผ ํด์.
๐ก ์ฐธ๊ณ ์ฌํญ
Transection์ด๋?
๋ ์ด์ ์ชผ๊ฐค ์ ์๋ ์ ๋ฌด ์ฒ๋ฆฌ์ ์ต์ ๋จ์๋ก A๊ฐ B๋ผ๋ ์ฌ๋์๊ฒ 1,000์์ ์ง๊ธํ๊ณ , B๊ฐ ๊ทธ ๋์ ๋ฐ์ ๊ฒฝ์ฐ, ์ด ๊ฑฐ๋ ๊ธฐ๋ก์ ๋ ์ด์ ์๊ฒ ์ชผ๊ฐค ์ ์๋ ํ๋์ ํธ๋์ญ์ ์ ๊ตฌ์ฑํ๋ค๊ณ ๋ณธ๋ค.
๋ง์ฝ A๋ ๋์ ์ง๋ถํ์ผ๋, B๊ฐ ๋์ ๋ฐ์ง ๋ชปํ๋ค๋ฉด ๊ทธ ๊ฑฐ๋๋ ์ฑ๋ฆฝํ์ง ์๋๋ค. ์ด์ฒ๋ผ A๊ฐ ๋์ ์ง๋ถํ๋ ํ์์ B๊ฐ ๋์ ๋ฐ๋ ํ์๋ ๋ณ๊ฐ๋ก ๋ถ๋ฆฌ๋ ์ ์์ผ๋ฉฐ, ํ๋์ ๊ฑฐ๋ ๋ด์ญ์ผ๋ก ์ฒ๋ฆฌ๋์ด์ผ ํ๋ ๋จ์ผ ๊ฑฐ๋์ด๋ฉฐ, ์ด ๋, ์ด๋ฐ ์ต์ ๋จ์๋ฅผ ํธ๋์ญ์ ์ด๋ผ ๋ถ๋ฅธ๋ค.
ํธ๋์ญ์ ์ฒ๋ฆฌ๊ฐ ์ ์์ ์ผ๋ก ์๋ฃ๋ ๊ฒฝ์ฐ ์ปค๋ฐ(Commit)ํ๊ณ , ์ค๋ฅ๊ฐ ๋ฐ์ํ ๊ฒฝ์ฐ ์๋ ์ํ๋๋ก ๋กค๋ฐฑ(Rollback)ํ๋ค.
ํธ๋์ญ์ ์ DBMS์ ์ฌ๋ฌ๊ฐ์ Client๊ฐ ๋์์ ์ ๊ทผํ๊ฑฐ๋, ์์ฉ ํ๋ก๊ทธ๋จ์ด ๊ฐฑ์ ์ฒ๋ฆฌ๋ฅผ ํ๋ ๊ณผ์ ์์ ์ค๋จ๋ ์ ์๋ ๊ฒฝ์ฐ ๋ฑ Data ๋ถ์ ํฉ์ ๋ฐฉ์งํ๊ณ ์ ํ ๋ ์ฌ์ฉํ๋ค. Data Base ๊ธฐ๋ฅ ์ค ํธ๋์ญ์ ์ ์กฐ์ํ๋ ๊ธฐ๋ฅ์ Data Base ์์ ์ฑ(Integrity) ์ ์ง๋ฅผ ํ์ ํ๊ฒ ํ๋ค.
๋จ์ผ ํธ๋์ญ์ ์ Data Base ๋ด์ ์ฝ๊ฑฐ๋, ์ฐ๋ ์ฌ๋ฌ๊ฐ Query๋ฅผ ์๊ตฌํ๊ฒ ๋๋๋ฐ, ์ด ๋, ์ค์ํ ๊ฒ์ Data Base๊ฐ ์ํ๋ ์ผ ๋ถ Query๊ฐ ๋จ์ง ์๋๋ค๋ ๊ฒ์ด๋ค.
์๋ฅผ ๋ค์ด ์ก๊ธ์ ํ ๋, ํ ๊ณ์ข์์ ์ธ์ถ๋๋ฉด ๋ค๋ฅธ ๊ณ์ข์์ ์ ๊ธ ํ์ธ ๋๋ ๊ฒ์ด ์ค์ํ๋ค. ๋ํ, ํธ๋์ญ์ ์ ์๋ก ๊ฐ์ญ์ด ์์ด์ผ ํ๋ค.
๋ง์ฝ Query ํ๋๊ฐ ์คํจํ๋ฉด Data Base๋ ์ ์ฒด ํธ๋์ญ์ ๋๋ ์คํจํ Query๋ฅผ ๋กค๋ฐฑํ๋ค. (DBMS์ ์ฌ์ฉ๋ฒ๊ณผ ์ค์ ์ ๋ฐ๋ผ ์์ด) ํธ๋์ญ์ ์ ์ปค๋ฐ์ ์ธ์ ๋ ์ง ์๋์ผ๋ก ๋กค๋ฐฑ๋ ์ ์๋ค.
์ฆ, ํธ๋์ญ์ ์ Data Base์ ์ํ๋ฅผ ๋ณํ์ํค๊ธฐ ์ํด ์ํํ๋ ์์ ์ ๋จ์์ด๋ค.
์ฃผ๋ํ๋์ Spring Boot์ ์๋ ๋ด์ฉ์ ๋ํ ์ํฉ๊ณผ ์ค์ ์ ์งํํด๋ณด๋ ค ํด์.
โ @Transaction(readOnly = true) ์ธ ๊ฒฝ์ฐ Slave DB ์ ๊ทผ.
โ @Transaction(readOnly = false) ์ธ ๊ฒฝ์ฐ Master DB ์ ๊ทผ.
์ฃผ๋ํ๋์ ์๋์ ๊ฐ์ด Data Base๋ฅผ ๊ตฌ์ฑํด ๋์์ด์.
์์ ๊ทธ๋ฆผ๊ณผ ๊ฐ์ด Sysnology NAS Docker๋ฅผ ์ด์ฉํ์ฌ Master DB์ธ Maria DB๋ฅผ ๊ตฌ์ฑํ๊ณ , WAS์ฉ์ผ๋ก ๊ตฌ์ฑ๋ Laptop์ Docker๋ฅผ ์ด์ฉํ์ง ์๊ณ , ์ง์ Slave DB์ธ Maria DB๋ฅผ ๊ตฌ์ฑํ์์ด์.
๐ฝ Project ๋ง๋ค๊ธฐ
๐ฆ Project ์์ฑ
์ฃผ๋ํ๋์ InteliJ Ultimate Version์ ์ฌ์ฉํ๊ณ ์์ด์ ์๋์ ๊ฐ์ด Project๋ฅผ ๋ง๋ค์ด ์ค๊ฑฐ์์.
์์ ๊ฐ์ด Test๋ฅผ ์ํด ํ์ํ ์์กด์ฑ์ ๊ตฌ์ฑํด ์ค ๊ฑฐ์์.
์ต์ด application.properties๋ฅผ application.yml๋ก ๋ฐ๊ฟ์ค๊ฒ์.
๐ฝ ์ค์
๐ฆ Data Base ์ค์
์ต์ด Test๋ฅผ ์ํ์ฌ Master DBMS์์ DB๋ฅผ ์์ฑํ๊ณ ,
๊ณ์ ๋ ๋ง๋ค์ด์ฃผ๊ณ , ํด๋น ๊ณ์ ์ Table ๊ถํ๋ ์์ ๊ฐ์ด ๋ฃ์ด์ฃผ์์ด์.
Slave์๋ ์์ ๊ฐ์ด repl_test DB๊ฐ ์๊ธด๊ฑธ ํ์ธํ ์ ์์ด์.
๐ฆ application.yml
๋ณธ๊ฒฉ์ ์ผ๋ก Spring Boot์ Data Base ์ค์ ์ ํด์ค๊ฒ์.
์ฌ์ค ์ฃผ๋ํ๋์ Local์์๋ H2 DB๋ฅผ ์ด์ฉํ๊ณ , Dev ํ๊ฒฝ์์๋ ์ด์คํํ MariaDB๋ฅผ ์ฐ๊ณ ์ถ์์ง๋ง,
์๋์์ ์ค์ ํ๋ DataSource ์ค์ ์ ์ด์คํ๊ฐ ๋์ง ์์ H2๋ฅผ ์ ์ฉํ ์๊ฐ ์์์ด์.
๋ง์ฝ ์ด๋ ๊ฒ ๊ตฌ์ฑํ๋ ๋ฐฉ๋ฒ์ ์์ ๋ค๋ฉด ๋๊ธ ๋ถํ๋๋ฆฝ๋๋ค.
์ต์ด ์์ ๊ฐ์ด Local ํ๊ฒฝ, ๊ฐ๋ฐ ํ๊ฒฝ์ ๊ตฌ๋ถํ๋๋ก ํ์๊ณ ,
์ปฌ ํ๊ฒฝ์ H2 DB๋ฅผ ์ด์ฉํ์ฌ ์ฌ์ฉํ ๊ฒ์ด๋ผ ์์ ๊ฐ์ด ์ค์ ์ ํด ์ฃผ์์ด์.
๊ทธ๋ฐ ๋ค ๊ฐ๋ฐ ํ๊ฒฝ์ Data Base ํ๊ฒฝ ๊ตฌ์ฑ์ ์ํด application-dev.yml์ ๋ง๋ค์ด ์ฃผ์์ด์.
์์ ๊ฐ์ด ๊ฐ๋ฐ ํ๊ฒฝ์์ ์ฌ์ฉํ Master์ Slave DBMS ์ค์ ์ ํด ์ฃผ์์ด์.
Master์ Slave DBMS ๋๊ฐ๋ฅผ ์ด์ฉํ๊ธฐ ๋๋ฌธ์ Datasource๋ฅผ ์ง์ ์์ฑํด ์ฃผ์ด์ผํด์.
๐ฝ Class ์์ฑ
๐ฆ Config Code ์์ฑ
์ด๋ฒ์๋ ์์์ ์ค์ ํ ๋ด์ฉ์ ๊ฐ์ง๊ณ , readOnly ์์ฑ ๋ณ๋ก ๋ถ๊ธฐ๋ฅผ ํ๊ธฐ ์ DataSource๋ฅผ Bean์ผ๋ก ๋ฑ๋กํ๋ ์ฝ๋๋ฅผ ์์ฑํด ์ค๊ฒ์.
ํด๋น Bean Class๋ฅผ ์์ฑํ๊ธฐ ์ํด ์์ ๊ฐ์ด Package์ Class๋ฅผ ์์ฑํด ์ฃผ์์ด์.
์์์ application-dev.yml์ ์ค์ ํ Data Base ์ค์ ๋ด์ฉ์ ๊ฐ์ ธ์ค๊ธฐ ์ํด
18๋ฒ์งธ ์ค๊ณผ 26๋ฒ์งธ ์ค์ ํด๋น ๊ฐ์ ๊ฐ์ ธ์ค๋๋ก ํด ์ฃผ์์ด์.
AbstractRoutingDataSource ๋ง๋ค๊ธฐ
AbstractRoutingDataSource.class๋ ์กฐํ Key ๊ธฐ๋ฐ์ผ๋ก ๋ฑ๋ก๋ DataSource ์ค ํ๋๋ฅผ ํธ์ถํ๊ฒ ํด ์ฃผ๋ ์น๊ตฌ์์.
ํ์ฌ ์กฐํ ํค๋ฅผ ๋ฐํ๋ฐ๊ธฐ ์ํด ์ถ์ Method๋ฅผ ๊ตฌํํ์ฌ ์ฃผ์์ด์.
์ด๋ฅผ ํตํด readOnly ์์ฑ์ ๊ตฌ๋ณํ์ฌ Key๋ฅผ ๋ฐํํ๊ฒ ํด์ค๋ต๋๋ค.
์ฆ, determineCurrentLookupKey()๋ Logic์ ๋ฐ๋ผ ๋ด๋ถ ๊ตฌํ์ด ๋ฐ๋๊ฒ ๋๋๋ฐ, URL Pattern์ ๋ฐ๋ฅธ ๋ถ๊ธฐ, Enum์ ์ด์ฉํ์ฌ ๋์ด์ค๋ Enum ๊ฐ์ ๋ฐ๋ฅธ DataSource ์ ํ, Session์์ Key ๊ฐ์ ํตํ ๋ถ๊ธฐ ๋ฑ์ด ๊ฐ๋ฅํด์.
ํ์ง๋ง, ์์ ๊ฐ์ด ์ค์ ๋ง ํ๋ฉด ๋ฌธ์ ๋ฅผ ๋ง๋๊ฒ ๋ ๊ฒ์ด์์.
Spring์ ์๋ AbstractRoutingDataSource๋ ์ฌ๋ฌ๊ฐ์ DataSource๋ฅผ ํ๋๋ก ๋ฌถ๊ณ , ์๋์ผ๋ก ๋ถ๊ธฐ ์ฒ๋ฆฌ๋ฅผ ํด์ฃผ๋ Spring Default Class์์.
์๋ง ์์ ๊ฐ์ด DB ์ด์คํ๋ฅผ ํ๊ฒ ๋๋ฉด ๊ตฌํํ์ฌ Spring์ ํ์ฌ ํธ๋์ญ์
์์ฑ์ ์ฝ์ด์ค๋ TransactionSynchronizationManager์ ์กฐํฉํ์ฌ ๋ถ๊ธฐ ์ฒ๋ฆฌ๋ฅผ ํ๋ ค ์ค์ ์ ํด ์ฃผ์์ง๋ง, ์ด๋ ๊ฒ ํ๊ฒ ๋๋ฉด TransactionSynchronizationManager๊ฐ ๋น๋ก @Transactional๋ก ์ ์ธ๋ ํ์ฌ ์ฐ๋ ๋์ ํธ๋์ญ์
์ํ๋ฅผ ์ฝ์ด๋
ธ๋๊ฒ ๊ฐ๋ฅํ๋๋ผ๋ ๋๊ธฐํ(Syncronation) ์์ ๊ณผ Connection ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ค๋ ์์ ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ธฐ ๋๋ฌธ์ด์์.
๐ก ์ฐธ๊ณ ์ฌํญ
Spring์์์ @Transactional ์ฒ๋ฆฌ ๋ฐฉ์
1. TransactionManager ์ ๋ณ
2. DataSource์์ Connection ํ๋
3. Transaction ๋๊ธฐํ
์์ ์ฐธ๊ณ ์ฌํญ์์ ๋ณด๋ฉด ํธ๋์ญ์
๋๊ธฐํ๋ฅผ ๋ง์น ๋ค ReplicationRoutingDataSource์์ Connection์ ํ๋ํด์ผ๋ง ์ ์ ๋์์ ํ ํ
๋ฐ, ์ด ์์๊ฐ ๋ค ๋ฐ๋์ด ์๋ค๋ ๊ฒ์ด ๋ฌธ์ ์์.
์ด ๋ฌธ์ ๋ก ์ธํด์ AbstractRoutingDataSource์ ์ด์ฉํ ๊ฒฝ์ฐ ๋ชจ๋ Query๊ฐ Master DBMS๋ก ๊ฐ๋ ํ์์ ๋ฐ๊ฒฌํ ์ ์์๊ฑฐ์์.
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด์๋ ReplicationRoutingDataSource๋ฅผ LazyConnectionDataSourceProxy๋ก ๊ฐ์ธ์ฃผ์ด์ ์ฒ๋ฆฌ๋ฅผ ํ๋ฉด ๋์.
LazyConnectionDataSourceProxy๋ ์ค์ง์ ์ธ Query ์คํ ์ฌ๋ถ์ ์๊ด์์ด ํธ๋์ญ์
์ด ๊ฑธ๋ฆฌ๋ฉด ๋ฌด์กฐ๊ฑด Connection ๊ฐ์ฒด๋ฅผ ํ๋ณดํ๋ Spring ๋จ์ ์ ๋ถ์ํ์ฌ ํธ๋์ญ์
์์์ Connection Proxy ๊ฐ์ฒด๋ฅผ ๋ฐํํ๊ณ , ์ค์ Query ๋ฐ์ ์์ DataSource์์ getConnection()์ ํธ์ถํ๋ ์ญํ ์ ํด์ค๋ต๋๋ค.
๐ก ์ฐธ๊ณ ์ฌํญ
LazyConnectionDataSourceProxy์ ์ฌ์ฉํ์ ๋, ์ฒ๋ฆฌ ๋ฐฉ์
1. TransactionManager ์ ๋ณ
2. LazyConnectionDataSourceProxy์์ Connection Proxy ๊ฐ์ฒด ํ๋
3. Transaction ๋๊ธฐํ
4. ์ค์ Query Call ํ ๋, ReplicationRoutingDataSource.getConection() / determineCurrentLookupKey() Call
์์ ์์์ ๊ฐ์ด Spring์ ํธ๋์ญ์
๊ณผ ์๋ง๋ ReplicationRoutingDataSource๊ฐ ๋ง๋ค์ด์ง๊ฒ ๋๋ต๋๋ค.
์์ ๊ฐ์ ์ด์ ๋ก Transaction ๋๊ธฐํ ์์ ์ Connection ํ๋์ ์ํด LazyConnectionDataSourceProxy๋ก ํ๋ฒ ๊ฐ์ธ์ฃผ์ด์ผ ํ๋ ์์
์ด ํ์ํด์.
DataSourceConfiguration ๋ด์ฉ ์ถ๊ฐ
์์์ ๋ง๋ค์๋ DataSourceConfiguration์ ์์ ๋ด์ฉ์ ์ถ๊ฐํด ์ฃผ์์ด์.
์ด๋ฅผ ํตํด DataSource Bean์ ์์ฑํ๋ Configuration Class๋ก ์ผ๋ฐ์ ์ธ DataSource๊ฐ ์๋ RoutingDataSource๋ฅผ ์์ฑํ์ฌ ๋ฐํํ๊ฒ ํด ์ฃผ์์ด์.
์ ์ฒด Source Code๋ฅผ ๋ณด๋ฉด ์์ ๊ฐ์ด ์์ฑ์ ํด ์ฃผ์์ด์.
์ต์ด @ConfigurationProperties๋ฅผ ํตํด application.properties๋, application.yml์ master, slave๋ก ๋๋ ๊ฐ๋ค์ ๊ฐ์ง๊ณ ์์ ๊ฐ๊ฐ์ MasterDataSource, SlaveDataSource๋ฅผ ์์ฑํ๊ณ , Bean์ผ๋ก ๋ฑ๋กํด ์ค๋๋ค.
๋ฐํ๋๋ RoutingDataSource๋ ์ฌ๋ฌ ๊ฐ(Master, Slave) DataSource ๊ฐ์ฒด๋ฅผ Key, Value ํํ๋ก ๋ด๊ณ , determineCurrentLookupKey()๋ฅผ ํตํด ๋ฐํ๋๋ Key ๊ฐ๊ณผ ์ผ์นํ๋ DataSource ๊ฐ์ฒด๋ฅผ ๋ฐํํ๊ฒ ํด์ฃผ์์ด์.
๊ทธ๋ฐ ๋ค RoutingDataSource๋ ์ต์ข
์ ์ผ๋ก LazyConnectionDataSourceProxy์ ์์ฌ ๋ฐํ๋๊ฒ ๋๋ต๋๋ค.
ํ์ง๋ง, ์ฌ๊ธฐ๊น์ง๋ง ๋ ์ค์ ํ๊ฒ ๋๋ฉด ์๋์ ๊ฐ์ด ์ข
์์ฑ ์ํ ๋ฌธ์ ๋ฅผ ๊ฒช๊ฒ ๋ ๊ฒ์ด์์.
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํ ์ฒซ๋ฒ์งธ ๋ฐฉ๋ฒ์ผ๋ก๋ @DependsOn์ ํตํด Bean์ ์ด๊ธฐํ ์์๋ฅผ ์๋์ผ๋ก ์ง์ ํด ์ฃผ๋ ๊ฒ์ด์์.
์์ ๊ฐ์ด ์์ ์ ํด ์ฃผ๋ฉด ๋๋ต๋๋ค.
๋๋ฒ์งธ ๋ฐฉ๋ฒ์ main()์ด ์๋ Class์์ @SpringBootApplication์
DataSourceAutoConfiguration.class๋ฅผ ๋นํ์ฑํ(Exclude) ์์ผ์ฃผ๋ ๋ฐฉ๋ฒ์ด์์.
์ด๋ ๊ฒ๋ ํด๊ฒฐํ ์ ์์ด์.
/Users/junyss/Library/Java/JavaVirtualMachines/azul-11.0.16/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:55113,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.profiles.active=dev -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:/Users/junyss/Library/Caches/JetBrains/IntelliJIdea2022.2/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -classpath /Users/junyss/Programming/study/Test/JunyHarangTest/mariaDB-duplication-Test/duplication_test/build/classes/java/main:/Users/junyss/Programming/study/Test/JunyHarangTest/mariaDB-duplication-Test/duplication_test/build/resources/main:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.24/13a394eed5c4f9efb2a6d956e2086f1d81e857d9/lombok-1.18.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-data-jpa/2.7.6/7eef599012347f2fb7f84ba71eba10caf094dfb5/spring-boot-starter-data-jpa-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-web/2.7.6/9d0166a0390df593243bdc798ca7a1db20ddea9c/spring-boot-starter-web-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-boot-starter/3.0.0/5486365e263f8acca014b97efa50c3419d58e8f6/springfox-boot-starter-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-aop/2.7.6/23061de1832242610092f212f99d49b9a4955a9d/spring-boot-starter-aop-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-jdbc/2.7.6/9db6def4ba06a11b67f0de3eac83441d00350dd6/spring-boot-starter-jdbc-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/jakarta.transaction/jakarta.transaction-api/1.3.3/c4179d48720a1e87202115fbed6089bdc4195405/jakarta.transaction-api-1.3.3.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/jakarta.persistence/jakarta.persistence-api/2.2.3/8f6ea5daedc614f07a3654a455660145286f024e/jakarta.persistence-api-2.2.3.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.hibernate/hibernate-core/5.6.14.Final/71e407089b71ed7c6e99385fd851c308fed7be44/hibernate-core-5.6.14.Final.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-jpa/2.7.6/8d0414f5cca5e31509943cd5f97cacdddd7c7384/spring-data-jpa-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-aspects/5.3.24/e97d36c3e516d3dd0579437428b6e26902da0c88/spring-aspects-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-json/2.7.6/77017e2aa78224c3fa10444d659c2ce8765b910/spring-boot-starter-json-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter/2.7.6/d15341c0fc0b1d1362ce6c737b34679ad1f836c/spring-boot-starter-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-tomcat/2.7.6/ec920cd7f951f3cff3a0b7af80bb8f7116a3d8a5/spring-boot-starter-tomcat-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-webmvc/5.3.24/33d2187c2bf1cb2c222bd1cc18b618736babcf3d/spring-webmvc-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-web/5.3.24/d89bbcaabb1ff247a089875cbc4211bfe96c9a59/spring-web-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-oas/3.0.0/e7bc9c1319cf1b64ae714a249c3db3b8fe01e42b/springfox-oas-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-data-rest/3.0.0/40f5e834d6696ae1d3212fa5a2d5e1ec406bedc0/springfox-data-rest-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-bean-validators/3.0.0/80c646fdebe5f2b2b337a5a686e540fee0b7304f/springfox-bean-validators-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-swagger2/3.0.0/7bcb18d496576eff76ef7bb72684e149cbb75c1d/springfox-swagger2-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-swagger-ui/3.0.0/1e665fbe22148f7c36fa8a08e515a0047cd4390b/springfox-swagger-ui-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml/classmate/1.5.1/3fe0bed568c62df5e89f4f174c101eab25345b6c/classmate-1.5.1.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.plugin/spring-plugin-metadata/2.0.0.RELEASE/6fb3a1fc0f05dc826687b7686ad8a5960ecdd57c/spring-plugin-metadata-2.0.0.RELEASE.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.plugin/spring-plugin-core/2.0.0.RELEASE/95fc8c13037630f4aba9c51141f535becec00fe6/spring-plugin-core-2.0.0.RELEASE.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.36/6c62681a2f655b49963a5983b8b0950a6120ae14/slf4j-api-1.7.36.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-aop/5.3.24/efd01bc1048a2e1b6a7442fbd78170bc02c342b7/spring-aop-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjweaver/1.9.7/158f5c255cd3e4408e795b79f7c3fbae9b53b7ca/aspectjweaver-1.9.7.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.zaxxer/HikariCP/4.0.3/107cbdf0db6780a065f895ae9d8fbf3bb0e1c21f/HikariCP-4.0.3.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jdbc/5.3.24/909c19ab470a59b9fd23177d26b8e880733b15d4/spring-jdbc-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.hibernate.common/hibernate-commons-annotations/5.1.2.Final/e59ffdbc6ad09eeb33507b39ffcf287679a498c8/hibernate-commons-annotations-5.1.2.Final.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.jboss.logging/jboss-logging/3.4.3.Final/c4bd7e12a745c0e7f6cf98c45cdcdf482fd827ea/jboss-logging-3.4.3.Final.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.12.19/178d26e6a95e50502ae16673e08269797f8b254a/byte-buddy-1.12.19.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/antlr/antlr/2.7.7/83cd2cd674a217ade95a4bb83a8a14f351f48bd0/antlr-2.7.7.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.jboss/jandex/2.4.2.Final/1e1c385990b258ff1a24c801e84aebbacf70eb39/jandex-2.4.2.Final.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.glassfish.jaxb/jaxb-runtime/2.3.7/ebcde6a44159eb9e3db721dfe6b45f26e6272341/jaxb-runtime-2.3.7.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-commons/2.7.6/e3d15a8f4d5ef0d2323569445c66903d0188cb68/spring-data-commons-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-context/5.3.24/e48634d7b8f40d4d0fe978830be0247bfc2ff2cd/spring-context-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-orm/5.3.24/256e029c2d8200294fe7fb5352ca2d1d7310dcad/spring-orm-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-tx/5.3.24/175a2157fce17669af6d4db1d094cb4baaa5c8fd/spring-tx-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-beans/5.3.24/e487ea6de09b9a7c36548028feeafa511a593532/spring-beans-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/5.3.24/d095c329f30baf2b6d44eccbd2352d7a2f840c72/spring-core-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.13.4/e6d820112871f33cd94a1dcc54eef58874753b5/jackson-datatype-jsr310-2.13.4.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-parameter-names/2.13.4/858ccf6624b5fac6044813e845063edb6a62cf37/jackson-module-parameter-names-2.13.4.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.13.4/557dbba5d8dfc7b7f944c58fe084109afcb5670b/jackson-datatype-jdk8-2.13.4.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.13.4.2/325c06bdfeb628cfb80ebaaf1a26cc1eb558a585/jackson-databind-2.13.4.2.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-logging/2.7.6/33a2d9e08d33a6a6f8051ed38daac14046e2f97c/spring-boot-starter-logging-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/2.7.6/4ad7e89accd25c69bfe84f52202deaf09430be2/spring-boot-autoconfigure-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/2.7.6/f96f89eba708a591704db5dcbfc03e8822a503aa/spring-boot-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/jakarta.annotation/jakarta.annotation-api/1.3.5/59eb84ee0d616332ff44aba065f3888cf002cd2d/jakarta.annotation-api-1.3.5.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.30/8fde7fe2586328ac3c68db92045e1c8759125000/snakeyaml-1.30.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-websocket/9.0.69/c5da77c17a667b4e7a6bb01fb3b28c46c2717123/tomcat-embed-websocket-9.0.69.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/9.0.69/27f2530eba96238aca56593bbd98edfdb038d9ef/tomcat-embed-core-9.0.69.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-el/9.0.69/9c89a289c35b9ec20bdfb692a22dab87256bbe67/tomcat-embed-el-9.0.69.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-expression/5.3.24/ae7410418e7b4bd27a01e3fb1c2fed35b2bc1e84/spring-expression-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-swagger-common/3.0.0/2e2fae840984cfcabfd50e1b4b1c23422135ba12/springfox-swagger-common-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-spring-webmvc/3.0.0/7ed22363fdfd651cd811c0b2391f16bddb91db8b/springfox-spring-webmvc-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-spring-web/3.0.0/a76f2fbe805bfd2798e20dc8f2cfbfad554d52da/springfox-spring-web-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-schema/3.0.0/32c5d6965617830ef6480fadb9030008945bcd9c/springfox-schema-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-spi/3.0.0/bae0b820d4b5a922063d34a42aaf4f763308b828/springfox-spi-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-core/3.0.0/7c3367ce577c8acd9bf64c74488c9269253516c9/springfox-core-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-spring-webflux/3.0.0/efccbcfe1d23f2ba520bd87cc156bf2b81f3568e/springfox-spring-webflux-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.swagger.core.v3/swagger-models/2.1.2/e7edeed6456a16d707542c003af03a594ecafe3a/swagger-models-2.1.2.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.swagger.core.v3/swagger-annotations/2.1.2/d407a33aa71444802c640080eb4d5f499b027f96/swagger-annotations-2.1.2.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.swagger/swagger-models/1.5.20/fb3a23bad80c5ed84db9dd150db2cba699531458/swagger-models-1.5.20.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.swagger/swagger-annotations/1.5.20/16051f93ce11ca489a5313775d825f82fcc2cd6c/swagger-annotations-1.5.20.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/jakarta.xml.bind/jakarta.xml.bind-api/2.3.3/48e3b9cfc10752fba3521d6511f4165bea951801/jakarta.xml.bind-api-2.3.3.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.glassfish.jaxb/txw2/2.3.7/55cddcac1945150e09b09b0f89d86799652eee82/txw2-2.3.7.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.sun.istack/istack-commons-runtime/3.0.12/cbbe1a62b0cc6c85972e99d52aaee350153dc530/istack-commons-runtime-3.0.12.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jcl/5.3.24/2b30878663ceed2af07238dc54e92e5bf001438d/spring-jcl-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.13.4/858c6cc78e1f08a885b1613e1d817c829df70a6e/jackson-annotations-2.13.4.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.13.4/cf934c681294b97ef6d80082faeefbe1edadf56/jackson-core-2.13.4.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.11/4741689214e9d1e8408b206506cbe76d1c6a7d60/logback-classic-1.2.11.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-to-slf4j/2.17.2/17dd0fae2747d9a28c67bc9534108823d2376b46/log4j-to-slf4j-2.17.2.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.slf4j/jul-to-slf4j/1.7.36/ed46d81cef9c412a88caef405b58f93a678ff2ca/jul-to-slf4j-1.7.36.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.github.classgraph/classgraph/4.8.83/7be289f451cedf9e35ed97caba3953226b4e6d9/classgraph-4.8.83.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.11/a01230df5ca5c34540cdaa3ad5efb012f1f1f792/logback-core-1.2.11.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.17.2/f42d6afa111b4dec5d2aea0fe2197240749a4ea6/log4j-api-2.17.2.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.h2database/h2/2.1.214/d5c2005c9e3279201e12d4776c948578b16bf8b2/h2-2.1.214.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.mariadb.jdbc/mariadb-java-client/3.0.9/8ebaa10da718ca9893e3c45e21951105cd6bfafb/mariadb-java-client-3.0.9.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.mysql/mysql-connector-j/8.0.31/3fd5850719d7e82d50705d34cc6a0037fab5731f/mysql-connector-j-8.0.31.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.mapstruct/mapstruct/1.3.1.Final/6ab184bbc7a7029738277a244e4c535fcdc3f558/mapstruct-1.3.1.Final.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.sun.activation/jakarta.activation/1.2.2/74548703f9851017ce2f556066659438019e7eb5/jakarta.activation-1.2.2.jar:/Users/junyss/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/222.4459.24/IntelliJ IDEA.app/Contents/lib/idea_rt.jar com.junyharang.duplication_test.DuplicationTestApplication
๋์ VM์ ์ฐ๊ฒฐ๋์์ต๋๋ค, ์ฃผ์: '127.0.0.1:55113', ์ ์ก: '์์ผ'
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.6)
2022-11-30 19:13:24.230 INFO 7762 --- [ main] c.j.d.DuplicationTestApplication : Starting DuplicationTestApplication using Java 11.0.16 on juniui-MacBookPro.local with PID 7762 (/Users/junyss/Programming/study/Test/JunyHarangTest/mariaDB-duplication-Test/duplication_test/build/classes/java/main started by junyss in /Users/junyss/Programming/study/Test/JunyHarangTest/mariaDB-duplication-Test/duplication_test)
2022-11-30 19:13:24.231 INFO 7762 --- [ main] c.j.d.DuplicationTestApplication : The following 3 profiles are active: "dev", "common", "dev-db"
2022-11-30 19:13:24.609 INFO 7762 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-11-30 19:13:24.616 INFO 7762 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 3 ms. Found 0 JPA repository interfaces.
2022-11-30 19:13:24.900 INFO 7762 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http)
2022-11-30 19:13:24.905 INFO 7762 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-11-30 19:13:24.905 INFO 7762 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.69]
2022-11-30 19:13:24.972 INFO 7762 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-11-30 19:13:24.973 INFO 7762 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 722 ms
2022-11-30 19:13:24.994 INFO 7762 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-11-30 19:13:25.083 INFO 7762 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2022-11-30 19:13:25.090 ERROR 7762 --- [ main] com.zaxxer.hikari.HikariConfig : HikariPool-2 - dataSource or dataSourceClassName or jdbcUrl is required.
2022-11-30 19:13:25.092 INFO 7762 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-3 - Starting...
2022-11-30 19:13:25.804 INFO 7762 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-3 - Start completed.
2022-11-30 19:13:25.812 INFO 7762 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Databases available at 'jdbc:mysql://{Master DBMS IP:PORT}/repl_test?serverTimezone=UTC&characterEncoding=UTF-8', 'jdbc:mysql://{Slave DBMS IP:PORT}/repl_test?serverTimezone=UTC&characterEncoding=UTF-8', 'jdbc:mysql://{Master DBMS IP:PORT}/repl_test?serverTimezone=UTC&characterEncoding=UTF-8', 'jdbc:mysql://{Master DBMS IP:PORT}/repl_test?serverTimezone=UTC&characterEncoding=UTF-8'
2022-11-30 19:13:25.907 INFO 7762 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-11-30 19:13:25.927 INFO 7762 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.14.Final
2022-11-30 19:13:25.985 INFO 7762 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-11-30 19:13:26.029 INFO 7762 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
2022-11-30 19:13:26.106 INFO 7762 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-11-30 19:13:26.111 INFO 7762 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-11-30 19:13:26.198 WARN 7762 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2022-11-30 19:13:26.444 INFO 7762 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path ''
2022-11-30 19:13:26.538 INFO 7762 --- [ main] c.j.d.DuplicationTestApplication : Started DuplicationTestApplication in 2.552 seconds (JVM running for 2.939)
์์ ๊ฐ์ด ์ ์์ ์ผ๋ก ์๋ํ๋ ๊ฒ์ ํ์ธํ์ด์.
๊ทธ๋ผ ๊ฐ๋จํ Test Code๋ฅผ ์์ฑํด์ ๋ณธ๊ฒฉ์ ์ผ๋ก ์ ์๋ํ๋์ง ํ์ธํด๋ณผ๊ฒ์.
๐ฝ ๊ฒ์ฆ
๐ฆ ์ ์ ์๋ ์ฌ๋ถ ํ์ธ
์ฃผ๋ํ๋์ Test๋ฅผ ์ํด ์๋์ ๊ฐ์ด Controller, Service, Repository๋ฅผ ๋ง๋ค์ด ์ฃผ์์ด์.
package com.junyharang.duplication_test.service.Impl;
import com.junyharang.duplication_test.common.constant.DefaultResponse;
import com.junyharang.duplication_test.common.constant.DefaultResponseMessage;
import com.junyharang.duplication_test.model.dto.request.BoardRequestDTO;
import com.junyharang.duplication_test.model.dto.request.BoardUpdateRequestDTO;
import com.junyharang.duplication_test.model.dto.response.BoardResponseDTO;
import com.junyharang.duplication_test.model.entity.Board;
import com.junyharang.duplication_test.repository.BoardRepository;
import lombok.RequiredArgsConstructor;
import com.junyharang.duplication_test.service.JunyHarangTestService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Optional;
@RequiredArgsConstructor
@Service
public class JunyHarangTestServiceImpl implements JunyHarangTestService {
private final BoardRepository boardRepository;
@Override
@Transactional
public DefaultResponse<Long> insertBoard(BoardRequestDTO boardRequestDTO) {
if (boardRequestDTO == null) {
return DefaultResponse.response(DefaultResponseMessage.BAD_REQUEST,
DefaultResponseMessage.KOREAN_400,
DefaultResponseMessage.ENGLISH_400);
}
Board board = Board.builder()
.title(boardRequestDTO.getTitle())
.content(boardRequestDTO.getContent())
.build();
Long saveId = boardRepository.save(board).getId();
return DefaultResponse.response(DefaultResponseMessage.CREATE_SUCCESS,
DefaultResponseMessage.KOREAN_201,
DefaultResponseMessage.ENGLISH_201,
saveId);
}
@Override
@Transactional(readOnly = true)
public DefaultResponse<List<Board>> getBoardList() {
return DefaultResponse.response(
DefaultResponseMessage.OK,
DefaultResponseMessage.KOREAN_200,
DefaultResponseMessage.ENGLISH_200,
boardRepository.findAll());
}
@Override
@Transactional(readOnly = true)
public DefaultResponse<BoardResponseDTO> getBoard(Long id) {
Optional<Board> boardById = findValueByID(id);
if (boardById.isEmpty()) {
return DefaultResponse.response(
DefaultResponseMessage.NOT_FOUND,
DefaultResponseMessage.KOREAN_404,
DefaultResponseMessage.ENGLISH_404);
}
return DefaultResponse.response(
DefaultResponseMessage.OK,
DefaultResponseMessage.KOREAN_200,
DefaultResponseMessage.ENGLISH_200,
BoardResponseDTO.builder()
.id(boardById.get().getId())
.title(boardById.get().getTitle())
.content(boardById.get().getContent())
.build());
}
@Override
@Transactional
public DefaultResponse<Long> updateBoard(Long id, BoardUpdateRequestDTO boardUpdateRequestDTO) {
Optional<Board> boardById = findValueByID(id);
if (boardById.isEmpty()) {
return DefaultResponse.response(
DefaultResponseMessage.NOT_FOUND,
DefaultResponseMessage.KOREAN_404,
DefaultResponseMessage.ENGLISH_404);
}
Board updateBoard = boardById.get().update(boardUpdateRequestDTO);
return DefaultResponse.response(
DefaultResponseMessage.CREATE_SUCCESS,
DefaultResponseMessage.KOREAN_201,
DefaultResponseMessage.ENGLISH_201,
boardRepository.save(updateBoard).getId());
}
@Override
@Transactional
public DefaultResponse<Long> deleteBoard(Long id) {
Optional<Board> boardById = findValueByID(id);
if (boardById.isEmpty()) {
return DefaultResponse.response(
DefaultResponseMessage.NOT_FOUND,
DefaultResponseMessage.KOREAN_404,
DefaultResponseMessage.ENGLISH_404);
}
boardRepository.delete(boardById.get());
return DefaultResponse.response(
DefaultResponseMessage.OK,
DefaultResponseMessage.KOREAN_200,
DefaultResponseMessage.ENGLISH_200,
id);
}
@Transactional(readOnly = true)
public Optional<Board> findValueByID(Long id) {
return boardRepository.findById(id);
}
}
JunyHarangTestServiceImpl
์์ธํ Source Code๋ ์ฃผ๋ํ๋์ GitHub ์ด ๊ณณ์ ์ฌ๋ ค๋์์ด์.
์์ ๊ฐ์ด ๋ง๋ค๊ณ ๋ ๋ค Spring Boot๋ฅผ ๊ธฐ๋ํ๋ Data Base์ Table์ด ์๊ธด๊ฑธ ํ์ธํ ์ ์์์ด์.
Console์ ์ฐํ Log๋ ์๋์ ๊ฐ์ด ๋์์ด์.
/Users/junyss/Library/Java/JavaVirtualMachines/azul-11.0.16/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:56100,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.profiles.active=dev -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:/Users/junyss/Library/Caches/JetBrains/IntelliJIdea2022.2/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -classpath /Users/junyss/Programming/study/Test/JunyHarangTest/mariaDB-duplication-Test/duplication_test/build/classes/java/main:/Users/junyss/Programming/study/Test/JunyHarangTest/mariaDB-duplication-Test/duplication_test/build/resources/main:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.24/13a394eed5c4f9efb2a6d956e2086f1d81e857d9/lombok-1.18.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-data-jpa/2.7.6/7eef599012347f2fb7f84ba71eba10caf094dfb5/spring-boot-starter-data-jpa-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-web/2.7.6/9d0166a0390df593243bdc798ca7a1db20ddea9c/spring-boot-starter-web-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-boot-starter/3.0.0/5486365e263f8acca014b97efa50c3419d58e8f6/springfox-boot-starter-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-aop/2.7.6/23061de1832242610092f212f99d49b9a4955a9d/spring-boot-starter-aop-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-jdbc/2.7.6/9db6def4ba06a11b67f0de3eac83441d00350dd6/spring-boot-starter-jdbc-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/jakarta.transaction/jakarta.transaction-api/1.3.3/c4179d48720a1e87202115fbed6089bdc4195405/jakarta.transaction-api-1.3.3.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/jakarta.persistence/jakarta.persistence-api/2.2.3/8f6ea5daedc614f07a3654a455660145286f024e/jakarta.persistence-api-2.2.3.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.hibernate/hibernate-core/5.6.14.Final/71e407089b71ed7c6e99385fd851c308fed7be44/hibernate-core-5.6.14.Final.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-jpa/2.7.6/8d0414f5cca5e31509943cd5f97cacdddd7c7384/spring-data-jpa-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-aspects/5.3.24/e97d36c3e516d3dd0579437428b6e26902da0c88/spring-aspects-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-json/2.7.6/77017e2aa78224c3fa10444d659c2ce8765b910/spring-boot-starter-json-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter/2.7.6/d15341c0fc0b1d1362ce6c737b34679ad1f836c/spring-boot-starter-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-tomcat/2.7.6/ec920cd7f951f3cff3a0b7af80bb8f7116a3d8a5/spring-boot-starter-tomcat-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-webmvc/5.3.24/33d2187c2bf1cb2c222bd1cc18b618736babcf3d/spring-webmvc-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-web/5.3.24/d89bbcaabb1ff247a089875cbc4211bfe96c9a59/spring-web-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-oas/3.0.0/e7bc9c1319cf1b64ae714a249c3db3b8fe01e42b/springfox-oas-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-data-rest/3.0.0/40f5e834d6696ae1d3212fa5a2d5e1ec406bedc0/springfox-data-rest-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-bean-validators/3.0.0/80c646fdebe5f2b2b337a5a686e540fee0b7304f/springfox-bean-validators-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-swagger2/3.0.0/7bcb18d496576eff76ef7bb72684e149cbb75c1d/springfox-swagger2-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-swagger-ui/3.0.0/1e665fbe22148f7c36fa8a08e515a0047cd4390b/springfox-swagger-ui-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml/classmate/1.5.1/3fe0bed568c62df5e89f4f174c101eab25345b6c/classmate-1.5.1.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.plugin/spring-plugin-metadata/2.0.0.RELEASE/6fb3a1fc0f05dc826687b7686ad8a5960ecdd57c/spring-plugin-metadata-2.0.0.RELEASE.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.plugin/spring-plugin-core/2.0.0.RELEASE/95fc8c13037630f4aba9c51141f535becec00fe6/spring-plugin-core-2.0.0.RELEASE.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.36/6c62681a2f655b49963a5983b8b0950a6120ae14/slf4j-api-1.7.36.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-aop/5.3.24/efd01bc1048a2e1b6a7442fbd78170bc02c342b7/spring-aop-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjweaver/1.9.7/158f5c255cd3e4408e795b79f7c3fbae9b53b7ca/aspectjweaver-1.9.7.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.zaxxer/HikariCP/4.0.3/107cbdf0db6780a065f895ae9d8fbf3bb0e1c21f/HikariCP-4.0.3.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jdbc/5.3.24/909c19ab470a59b9fd23177d26b8e880733b15d4/spring-jdbc-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.hibernate.common/hibernate-commons-annotations/5.1.2.Final/e59ffdbc6ad09eeb33507b39ffcf287679a498c8/hibernate-commons-annotations-5.1.2.Final.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.jboss.logging/jboss-logging/3.4.3.Final/c4bd7e12a745c0e7f6cf98c45cdcdf482fd827ea/jboss-logging-3.4.3.Final.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.12.19/178d26e6a95e50502ae16673e08269797f8b254a/byte-buddy-1.12.19.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/antlr/antlr/2.7.7/83cd2cd674a217ade95a4bb83a8a14f351f48bd0/antlr-2.7.7.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.jboss/jandex/2.4.2.Final/1e1c385990b258ff1a24c801e84aebbacf70eb39/jandex-2.4.2.Final.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.glassfish.jaxb/jaxb-runtime/2.3.7/ebcde6a44159eb9e3db721dfe6b45f26e6272341/jaxb-runtime-2.3.7.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-commons/2.7.6/e3d15a8f4d5ef0d2323569445c66903d0188cb68/spring-data-commons-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-context/5.3.24/e48634d7b8f40d4d0fe978830be0247bfc2ff2cd/spring-context-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-orm/5.3.24/256e029c2d8200294fe7fb5352ca2d1d7310dcad/spring-orm-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-tx/5.3.24/175a2157fce17669af6d4db1d094cb4baaa5c8fd/spring-tx-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-beans/5.3.24/e487ea6de09b9a7c36548028feeafa511a593532/spring-beans-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/5.3.24/d095c329f30baf2b6d44eccbd2352d7a2f840c72/spring-core-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.13.4/e6d820112871f33cd94a1dcc54eef58874753b5/jackson-datatype-jsr310-2.13.4.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-parameter-names/2.13.4/858ccf6624b5fac6044813e845063edb6a62cf37/jackson-module-parameter-names-2.13.4.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.13.4/557dbba5d8dfc7b7f944c58fe084109afcb5670b/jackson-datatype-jdk8-2.13.4.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.13.4.2/325c06bdfeb628cfb80ebaaf1a26cc1eb558a585/jackson-databind-2.13.4.2.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-logging/2.7.6/33a2d9e08d33a6a6f8051ed38daac14046e2f97c/spring-boot-starter-logging-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/2.7.6/4ad7e89accd25c69bfe84f52202deaf09430be2/spring-boot-autoconfigure-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/2.7.6/f96f89eba708a591704db5dcbfc03e8822a503aa/spring-boot-2.7.6.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/jakarta.annotation/jakarta.annotation-api/1.3.5/59eb84ee0d616332ff44aba065f3888cf002cd2d/jakarta.annotation-api-1.3.5.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.30/8fde7fe2586328ac3c68db92045e1c8759125000/snakeyaml-1.30.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-websocket/9.0.69/c5da77c17a667b4e7a6bb01fb3b28c46c2717123/tomcat-embed-websocket-9.0.69.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/9.0.69/27f2530eba96238aca56593bbd98edfdb038d9ef/tomcat-embed-core-9.0.69.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-el/9.0.69/9c89a289c35b9ec20bdfb692a22dab87256bbe67/tomcat-embed-el-9.0.69.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-expression/5.3.24/ae7410418e7b4bd27a01e3fb1c2fed35b2bc1e84/spring-expression-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-swagger-common/3.0.0/2e2fae840984cfcabfd50e1b4b1c23422135ba12/springfox-swagger-common-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-spring-webmvc/3.0.0/7ed22363fdfd651cd811c0b2391f16bddb91db8b/springfox-spring-webmvc-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-spring-web/3.0.0/a76f2fbe805bfd2798e20dc8f2cfbfad554d52da/springfox-spring-web-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-schema/3.0.0/32c5d6965617830ef6480fadb9030008945bcd9c/springfox-schema-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-spi/3.0.0/bae0b820d4b5a922063d34a42aaf4f763308b828/springfox-spi-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-core/3.0.0/7c3367ce577c8acd9bf64c74488c9269253516c9/springfox-core-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.springfox/springfox-spring-webflux/3.0.0/efccbcfe1d23f2ba520bd87cc156bf2b81f3568e/springfox-spring-webflux-3.0.0.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.swagger.core.v3/swagger-models/2.1.2/e7edeed6456a16d707542c003af03a594ecafe3a/swagger-models-2.1.2.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.swagger.core.v3/swagger-annotations/2.1.2/d407a33aa71444802c640080eb4d5f499b027f96/swagger-annotations-2.1.2.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.swagger/swagger-models/1.5.20/fb3a23bad80c5ed84db9dd150db2cba699531458/swagger-models-1.5.20.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.swagger/swagger-annotations/1.5.20/16051f93ce11ca489a5313775d825f82fcc2cd6c/swagger-annotations-1.5.20.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/jakarta.xml.bind/jakarta.xml.bind-api/2.3.3/48e3b9cfc10752fba3521d6511f4165bea951801/jakarta.xml.bind-api-2.3.3.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.glassfish.jaxb/txw2/2.3.7/55cddcac1945150e09b09b0f89d86799652eee82/txw2-2.3.7.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.sun.istack/istack-commons-runtime/3.0.12/cbbe1a62b0cc6c85972e99d52aaee350153dc530/istack-commons-runtime-3.0.12.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jcl/5.3.24/2b30878663ceed2af07238dc54e92e5bf001438d/spring-jcl-5.3.24.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.13.4/858c6cc78e1f08a885b1613e1d817c829df70a6e/jackson-annotations-2.13.4.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.13.4/cf934c681294b97ef6d80082faeefbe1edadf56/jackson-core-2.13.4.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.11/4741689214e9d1e8408b206506cbe76d1c6a7d60/logback-classic-1.2.11.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-to-slf4j/2.17.2/17dd0fae2747d9a28c67bc9534108823d2376b46/log4j-to-slf4j-2.17.2.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.slf4j/jul-to-slf4j/1.7.36/ed46d81cef9c412a88caef405b58f93a678ff2ca/jul-to-slf4j-1.7.36.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/io.github.classgraph/classgraph/4.8.83/7be289f451cedf9e35ed97caba3953226b4e6d9/classgraph-4.8.83.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.11/a01230df5ca5c34540cdaa3ad5efb012f1f1f792/logback-core-1.2.11.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.17.2/f42d6afa111b4dec5d2aea0fe2197240749a4ea6/log4j-api-2.17.2.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.h2database/h2/2.1.214/d5c2005c9e3279201e12d4776c948578b16bf8b2/h2-2.1.214.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.mariadb.jdbc/mariadb-java-client/3.0.9/8ebaa10da718ca9893e3c45e21951105cd6bfafb/mariadb-java-client-3.0.9.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.mysql/mysql-connector-j/8.0.31/3fd5850719d7e82d50705d34cc6a0037fab5731f/mysql-connector-j-8.0.31.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/org.mapstruct/mapstruct/1.3.1.Final/6ab184bbc7a7029738277a244e4c535fcdc3f558/mapstruct-1.3.1.Final.jar:/Users/junyss/.gradle/caches/modules-2/files-2.1/com.sun.activation/jakarta.activation/1.2.2/74548703f9851017ce2f556066659438019e7eb5/jakarta.activation-1.2.2.jar:/Users/junyss/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/222.4459.24/IntelliJ IDEA.app/Contents/lib/idea_rt.jar com.junyharang.duplication_test.DuplicationTestApplication
๋์ VM์ ์ฐ๊ฒฐ๋์์ต๋๋ค, ์ฃผ์: '127.0.0.1:56100', ์ ์ก: '์์ผ'
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.6)
2022-11-30 21:06:46.055 INFO 9513 --- [ main] c.j.d.DuplicationTestApplication : Starting DuplicationTestApplication using Java 11.0.16 on juniui-MacBookPro.local with PID 9513 (/Users/junyss/Programming/study/Test/JunyHarangTest/mariaDB-duplication-Test/duplication_test/build/classes/java/main started by junyss in /Users/junyss/Programming/study/Test/JunyHarangTest/mariaDB-duplication-Test/duplication_test)
2022-11-30 21:06:46.056 INFO 9513 --- [ main] c.j.d.DuplicationTestApplication : The following 3 profiles are active: "dev", "common", "dev-db"
2022-11-30 21:06:46.453 INFO 9513 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-11-30 21:06:46.480 INFO 9513 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 23 ms. Found 1 JPA repository interfaces.
2022-11-30 21:06:46.774 INFO 9513 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-11-30 21:06:46.779 INFO 9513 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-11-30 21:06:46.779 INFO 9513 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.69]
2022-11-30 21:06:46.835 INFO 9513 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-11-30 21:06:46.835 INFO 9513 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 756 ms
2022-11-30 21:06:46.879 INFO 9513 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-11-30 21:06:46.968 INFO 9513 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2022-11-30 21:06:47.026 INFO 9513 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-11-30 21:06:47.045 INFO 9513 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.14.Final
2022-11-30 21:06:47.107 INFO 9513 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-11-30 21:06:47.152 INFO 9513 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
Hibernate:
drop table if exists board
Hibernate:
create table board (
id bigint not null auto_increment,
create_date_time datetime,
modified_date_time datetime,
content TEXT not null,
title varchar(500) not null,
primary key (id)
) engine=InnoDB
2022-11-30 21:06:50.134 INFO 9513 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-11-30 21:06:50.145 INFO 9513 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-11-30 21:06:50.366 WARN 9513 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2022-11-30 21:06:50.615 INFO 9513 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2022-11-30 21:06:50.745 INFO 9513 --- [ main] c.j.d.DuplicationTestApplication : Started DuplicationTestApplication in 4.908 seconds (JVM running for 5.291)
์์ ๊ฐ์ด Table์ด ๋ง๋ค์ด์ง๊ฑธ ์ ์ ์์ด์.
Master์์ board๋ผ๋ Table์ ํ์ธํ ์ ์์ด์.
Slave DBMS์๋ ๋์ผํ๊ฒ Table๊ณผ DB๋ฑ์ด ๋ง๋ค์ด์ง๊ฑธ ํ์ธํ ์ ์์ด์.
๋ง์ฝ ์๋์ ๊ฐ์ ๋ฌธ์ ๊ฐ ๋์จ๋ค๋ฉด
๋์ VM์ ์ฐ๊ฒฐ๋์์ต๋๋ค, ์ฃผ์: '127.0.0.1:56228', ์ ์ก: '์์ผ'
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.6)
2022-11-30 21:14:59.300 INFO 9710 --- [ main] c.j.d.DuplicationTestApplication : Starting DuplicationTestApplication using Java 11.0.16 on juniui-MacBookPro.local with PID 9710 (/Users/junyss/Programming/study/Test/JunyHarangTest/mariaDB-duplication-Test/duplication_test/build/classes/java/main started by junyss in /Users/junyss/Programming/study/Test/JunyHarangTest/mariaDB-duplication-Test/duplication_test)
2022-11-30 21:14:59.301 INFO 9710 --- [ main] c.j.d.DuplicationTestApplication : The following 3 profiles are active: "dev", "common", "dev-db"
2022-11-30 21:14:59.677 INFO 9710 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-11-30 21:14:59.706 INFO 9710 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 25 ms. Found 1 JPA repository interfaces.
2022-11-30 21:15:00.000 INFO 9710 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-11-30 21:15:00.005 INFO 9710 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-11-30 21:15:00.005 INFO 9710 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.69]
2022-11-30 21:15:00.075 INFO 9710 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-11-30 21:15:00.075 INFO 9710 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 754 ms
2022-11-30 21:15:00.121 INFO 9710 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-11-30 21:15:31.198 ERROR 9710 --- [ 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]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na]
at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:194) ~[spring-jdbc-5.3.24.jar:5.3.24]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.afterPropertiesSet(LazyConnectionDataSourceProxy.java:164) ~[spring-jdbc-5.3.24.jar:5.3.24]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.<init>(LazyConnectionDataSourceProxy.java:108) ~[spring-jdbc-5.3.24.jar:5.3.24]
at com.junyharang.duplication_test.common.config.DataBase.DataSourceConfiguration.dataSource(DataSourceConfiguration.java:58) ~[main/:na]
at com.junyharang.duplication_test.common.config.DataBase.DataSourceConfiguration$$EnhancerBySpringCGLIB$$1b143e2e.CGLIB$dataSource$3(<generated>) ~[main/:na]
at com.junyharang.duplication_test.common.config.DataBase.DataSourceConfiguration$$EnhancerBySpringCGLIB$$1b143e2e$$FastClassBySpringCGLIB$$4600f72a.invoke(<generated>) ~[main/:na]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.24.jar:5.3.24]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.24.jar:5.3.24]
at com.junyharang.duplication_test.common.config.DataBase.DataSourceConfiguration$$EnhancerBySpringCGLIB$$1b143e2e.dataSource(<generated>) ~[main/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.6.jar:2.7.6]
at com.junyharang.duplication_test.DuplicationTestApplication.main(DuplicationTestApplication.java:11) ~[main/:na]
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: 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 java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.NativeSession.connect(NativeSession.java:120) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:948) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:818) ~[mysql-connector-j-8.0.31.jar:8.0.31]
... 60 common frames omitted
Caused by: java.net.SocketTimeoutException: connect timed out
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) ~[na:na]
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:na]
at java.base/java.net.Socket.connect(Socket.java:615) ~[na:na]
at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:153) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) ~[mysql-connector-j-8.0.31.jar:8.0.31]
... 63 common frames omitted
2022-11-30 21:15:31.201 INFO 9710 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-11-30 21:16:02.215 ERROR 9710 --- [ 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]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na]
at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:194) ~[spring-jdbc-5.3.24.jar:5.3.24]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.afterPropertiesSet(LazyConnectionDataSourceProxy.java:164) ~[spring-jdbc-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.6.jar:2.7.6]
at com.junyharang.duplication_test.DuplicationTestApplication.main(DuplicationTestApplication.java:11) ~[main/:na]
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: 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 java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.NativeSession.connect(NativeSession.java:120) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:948) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:818) ~[mysql-connector-j-8.0.31.jar:8.0.31]
... 46 common frames omitted
Caused by: java.net.SocketTimeoutException: connect timed out
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) ~[na:na]
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:na]
at java.base/java.net.Socket.connect(Socket.java:615) ~[na:na]
at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:153) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) ~[mysql-connector-j-8.0.31.jar:8.0.31]
... 49 common frames omitted
2022-11-30 21:16:02.296 INFO 9710 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-11-30 21:16:02.318 INFO 9710 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.14.Final
2022-11-30 21:16:02.377 INFO 9710 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-11-30 21:16:02.419 INFO 9710 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-11-30 21:16:33.429 ERROR 9710 --- [ 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]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na]
at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:194) ~[spring-jdbc-5.3.24.jar:5.3.24]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:405) ~[spring-jdbc-5.3.24.jar:5.3.24]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:378) ~[spring-jdbc-5.3.24.jar:5.3.24]
at com.sun.proxy.$Proxy92.getMetaData(Unknown Source) ~[na:na]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:70) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:175) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:173) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:127) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1460) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1494) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.6.jar:2.7.6]
at com.junyharang.duplication_test.DuplicationTestApplication.main(DuplicationTestApplication.java:11) ~[main/:na]
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: 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 java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.NativeSession.connect(NativeSession.java:120) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:948) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:818) ~[mysql-connector-j-8.0.31.jar:8.0.31]
... 51 common frames omitted
Caused by: java.net.SocketTimeoutException: connect timed out
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) ~[na:na]
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:na]
at java.base/java.net.Socket.connect(Socket.java:615) ~[na:na]
at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:153) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) ~[mysql-connector-j-8.0.31.jar:8.0.31]
... 54 common frames omitted
2022-11-30 21:16:33.431 WARN 9710 --- [ main] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000339: Could not obtain connection 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.
2022-11-30 21:16:33.452 INFO 9710 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
Hibernate:
drop table if exists board
2022-11-30 21:16:33.713 INFO 9710 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-11-30 21:17:04.717 ERROR 9710 --- [ 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]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na]
at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:194) ~[spring-jdbc-5.3.24.jar:5.3.24]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:405) ~[spring-jdbc-5.3.24.jar:5.3.24]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:378) ~[spring-jdbc-5.3.24.jar:5.3.24]
at com.sun.proxy.$Proxy92.getAutoCommit(Unknown Source) ~[na:na]
at org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl.getIsolatedConnection(DdlTransactionIsolatorNonJtaImpl.java:47) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.jdbcStatement(GenerationTargetToDatabase.java:77) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:53) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlString(SchemaDropperImpl.java:387) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlStrings(SchemaDropperImpl.java:371) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropFromMetadata(SchemaDropperImpl.java:246) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.performDrop(SchemaDropperImpl.java:156) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:128) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:114) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:157) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:85) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:335) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:471) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1498) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.6.jar:2.7.6]
at com.junyharang.duplication_test.DuplicationTestApplication.main(DuplicationTestApplication.java:11) ~[main/:na]
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: 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 java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.NativeSession.connect(NativeSession.java:120) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:948) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:818) ~[mysql-connector-j-8.0.31.jar:8.0.31]
... 51 common frames omitted
Caused by: java.net.SocketTimeoutException: connect timed out
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) ~[na:na]
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:na]
at java.base/java.net.Socket.connect(Socket.java:615) ~[na:na]
at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:153) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) ~[mysql-connector-j-8.0.31.jar:8.0.31]
... 54 common frames omitted
2022-11-30 21:17:04.719 WARN 9710 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 08S01
2022-11-30 21:17:04.719 ERROR 9710 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : 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.
2022-11-30 21:17:04.727 ERROR 9710 --- [ main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to check JDBC Connection auto-commit in preparation for DDL execution
2022-11-30 21:17:04.730 WARN 9710 --- [ 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 javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to check JDBC Connection auto-commit in preparation for DDL execution
2022-11-30 21:17:04.732 INFO 9710 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-11-30 21:17:04.745 INFO 9710 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-11-30 21:17:04.764 ERROR 9710 --- [ 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 javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to check JDBC Connection auto-commit in preparation for DDL execution
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.6.jar:2.7.6]
at com.junyharang.duplication_test.DuplicationTestApplication.main(DuplicationTestApplication.java:11) ~[main/:na]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to check JDBC Connection auto-commit in preparation for DDL execution
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:421) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.24.jar:5.3.24]
... 16 common frames omitted
Caused by: org.hibernate.exception.JDBCConnectionException: Unable to check JDBC Connection auto-commit in preparation for DDL execution
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:37) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl.getIsolatedConnection(DdlTransactionIsolatorNonJtaImpl.java:64) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.jdbcStatement(GenerationTargetToDatabase.java:77) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:53) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlString(SchemaDropperImpl.java:387) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlStrings(SchemaDropperImpl.java:371) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropFromMetadata(SchemaDropperImpl.java:246) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.performDrop(SchemaDropperImpl.java:156) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:128) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:114) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:157) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:85) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:335) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:471) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1498) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.24.jar:5.3.24]
... 20 common frames omitted
Caused by: 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]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na]
at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:194) ~[spring-jdbc-5.3.24.jar:5.3.24]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:405) ~[spring-jdbc-5.3.24.jar:5.3.24]
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:378) ~[spring-jdbc-5.3.24.jar:5.3.24]
at com.sun.proxy.$Proxy92.getAutoCommit(Unknown Source) ~[na:na]
at org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl.getIsolatedConnection(DdlTransactionIsolatorNonJtaImpl.java:47) ~[hibernate-core-5.6.14.Final.jar:5.6.14.Final]
... 36 common frames omitted
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: 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 java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.NativeSession.connect(NativeSession.java:120) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:948) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:818) ~[mysql-connector-j-8.0.31.jar:8.0.31]
... 51 common frames omitted
Caused by: java.net.SocketTimeoutException: connect timed out
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) ~[na:na]
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:na]
at java.base/java.net.Socket.connect(Socket.java:615) ~[na:na]
at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:153) ~[mysql-connector-j-8.0.31.jar:8.0.31]
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) ~[mysql-connector-j-8.0.31.jar:8.0.31]
... 54 common frames omitted
๋์ VM์์ ์ฐ๊ฒฐ ํด์ ๋์์ต๋๋ค. ์ฃผ์: '127.0.0.1:56228', ์ ์ก: '์์ผ'
์ข
๋ฃ ์ฝ๋ 1(์ผ)๋ก ์๋ฃ๋ ํ๋ก์ธ์ค
ํด๊ฒฐ ๋ฐฉ์์ ์ด ๊ณณ์ ์ ๋ฆฌํด ๋์์ด์ :)
Swagger๋ฅผ ์ด์ฉํด์ ๊ฐ์ ๋ฃ์ด๋ณด๊ณ , ์กฐํ๋ฅผ ํด ๋ณผ๊ฒ์.
์์ ๊ฐ์ด ์ ์์ ์ผ๋ก DB์ ๊ฐ์ด ๋ค์ด๊ฐ๊ฑธ ํ์ธํ ์ ์์ด์.
์ด๋ฒ์ ์กฐํ๋ฅผ ํ๋ฒ ํด ๋ณผ๊ฒ์.
๋ชฉ๋ก ์กฐํ๋ ์ ์์ ์ผ๋ก ๋๋ ๊ฒ์ ํ์ธํ ์ ์์ด์.
์์ธ ์กฐํ๋ ์ ์์ ์ผ๋ก ๋๋ ๊ฒ์ ํ์ธํ ์ ์์ด์.
10๋ฒ์งธ Data๋ฅผ ์ง์ ๋ณด์์ด์.
์ด์คํ์ ๋ํ DataSource ์ค์ ์ด ์ ์คํ๋๋์ง ํ์ธํ๊ธฐ ์ํด์
์์ ๊ฐ์ด Delete๋๋ @Transactional์ ๋ถ์ด์ง ์๊ณ , ์๋ ํ์์ด์.
๊ทธ๋ฌ๋๋ ์์ ๊ฐ์ด Master DBMS์ ๊ฐ์ ์ง์์ง์ง ์์๊ณ ,
Slave DBMS์ 10๋ฒ์งธ Data๊ฐ ์ง์์ง๊ฒ์ ํ์ธํ ์ ์์์ด์.
์ด๋ ๊ฒ @Transactional์ ํตํด์ ๊ฐ๊ฐ์ DBMS์ ์ญํ ์ ๋ถ๋ฐฐํ๊ณ , ๋ถํ๋ฅผ ๋ถ์ฐ ์ํฌ ์ ์๋ค๋ ๊ฒ์ ํ์ธํ์์ด์.
๐ง ์ฐธ๊ณ ์๋ฃ
"์ด ํฌ์คํ ์ ์ฟ ํก ํํธ๋์ค ํ๋์ ์ผํ์ผ๋ก, ์ด์ ๋ฐ๋ฅธ ์ผ์ ์ก์ ์์๋ฃ๋ฅผ ์ ๊ณต๋ฐ์ต๋๋ค."