์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- DP
- ๋ถํ ์ ๋ณต
- ์ฐ์ ์์ ํ
- java
- ์ฌ๊ท
- ๋ฌธ์์ด
- ์์ ์ ๋ ฌ
- ์คํ
- c++
- ๋ฐ์ดํฌ์คํธ๋ผ
- ์ด๋ถ ํ์
- CVE
- ๊ตฌํ
- ์๋ฎฌ๋ ์ด์
- dfs
- error
- ๋งต
- Spring
- GCP
- dynamic debugging
- ๋์ ํฉ
- ์ต๋จ ๊ฒฝ๋ก
- Reversing
- thymeleaf
- JPA
- OS
- ๊ทธ๋ฆฌ๋
- ๋ฐฑํธ๋ํน
- BFS
- web
- Today
- Total
๋ชฉ๋ก๐๐ปโ๏ธ ๊ธฐ๋ณธํ๋ จ/Spring (14)
hades

ํ๋ก์ ํธ ํ๊ฒฝ์ค์ H2์ Thymeleaf ๋์ ํ์ธ ํ, application.yml ํ์ผ ์์ฑSpring: datasource: url: jdbc:h2:tcp://localhost/~/jpashop; username : sa password: driver-class-name: org.h2.Driver jpa: hibernate: ddl-auto: create properties: hibernate:# show_sql: true format_sql: truelogging: level: org.hibernate.SQL: debugddl-auto: create๋ ์ ํ๋ฆฌ์ผ์ด์ ์คํ ์์ ์ ํ ์ด๋ธ์ ์๋ก ์์ฑํ๋ค. Membe..

๐จ ์๋ฌParameter 0 of constructor in hello.core.member.MemberServiceImpl required a single bean, but 2 were found: - memoryMemberRepository: defined in file [C:\Users\hades\Desktop\study\core\out\production\classes\hello\core\member\MemoryMemberRepository.class] - memberRepository: defined by method 'memberRepository' in class path resource [hello/core/AppConfig.class] ๐ ๋ถ์MemberServiceImpl์ด ํ๋์ ..

์คํ๋ง ์ปจํ ์ด๋์ ์คํ๋ง ๋น์คํ๋ง ์ปจํ ์ด๋ ์์ฑApplicationContext๋ ์คํ๋ง ์ปจํ ์ด๋์ด์ ์ธํฐํ์ด์ค์ด๋ค. ๋ฐ๋ผ์ ๋คํ์ฑ์ด ์ ์ฉ๋๋ค. AnnotationConfigApplicationContext๋ ์๊ณ , ๋ค๋ฅธ ApplicationContext๋ค๋ ์๋ค.์ค์ ์์ ๋ํ๋ด๋ @Configuration์ด ๋ถ์ AppConfig.class๋ฅผ ๋งค๊ฐ๋ณ์๋ก ํ๋ AnnotationConfigApplicationContext์ ์์ฑํ๋ฉด, @Bean์ด ๋ถ์ ๊ฒ๋ค์ด ์คํ๋ง ์ ์ฅ์์ ์ ์ฅ๋๋ค. ๋น ์ด๋ฆ์ ๋ฉ์๋ ์ด๋ฆ, ๋น ๊ฐ์ฒด๋ return ๊ฐ์ด๋ค. ๋น์ ์ด๋ฆ์ ๊ธฐ๋ณธ์ ์ผ๋ก ๋ฉ์๋ ์ด๋ฆ์ด๋ฉฐ, ํญ์ ๋ค๋ฅธ ์ด๋ฆ์ ๋ถ์ฌํด์ผ ํ๋ค. 3. ์คํ๋ง ๋น ์์กด ๊ด๊ณ ์ค์ ์คํ๋ง ์ปจํ ์ด๋๋ ์ค์ ์ ๋ณด๋ฅผ ์ฐธ๊ณ ํด์ ์์กด๊ด๊ณ๋ฅผ ์ฃผ์ ํ๋ค...

ํ๋ก์ ํธ ์์ฑSpring ํ๋ก์ ํธ๋ https://start.spring.io/ ์์ ์์ฑํ๋ค.๊ธฐ๋ณธ์ ์ผ๋ก ์์ ๊ฐ์ด ์ค์ ํ Generateํ๋ฉด ํ๋ก์ ํธ๊ฐ ์์ฑ๋๋ค. ๊ตฌ์ฑ ํญ๋ชฉ๋ค์ ์ดํด๋ณด์. src์์ main๊ณผ test๋ฅผ ๋ถ๋ฆฌํด๋์๋๋ฐ, ์ด๋ test๊ฐ ์์ฆ ๊ฐ๋ฐ์์ ์ค์ํ๋ค๋ ๊ฒ์ ์๋ฏธํ๋ค.main์์ java๋ฅผ ์ ์ธํ ๋ชจ๋ ํ์ผ์ resources์ ์๋ค. gradle์ ๋ฒ์ ์ค์ ๋ฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๊ฐ์ ธ์ค๋ ์ญํ ์ ํ๋ค. HelloSpringApplication์ Application์ ์คํ์ํค๋๋ฐ ์์ฒด์ ์ผ๋ก ์๋ฒ ๊ธฐ๋ฅ์ ํ ์ ์๊ฒ ํด์ฃผ๋ ํฐ์บฃ์ ๋ด์ฅํ๊ณ ์์ด์, ์๋ฒ ์ญํ ์ ๊ฐ๋ฅํ๊ฒ ํ๋ค. Setting - Build - Gradle์์ IntelliJ IDEA๋ก ๋ฐ๊พธ๋ฉด, ์์ฒด์ ์ผ๋ก ์คํํ์ฌ ๋นจ๋ผ..