1. ๋ฐ์ํ ์๋ฌ
Spring Boot 3.5.5 ํ๋ก์ ํธ ์คํ ์ ๋ค์๊ณผ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค.
org.springframework.beans.factory.BeanDefinitionStoreException:
Invalid bean definition with name 'memberMapper'
Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
@mapper๋ ๋ฃ๊ณ @mapperscan๋ ๋ฃ์ด๋ดค์ง๋ง ์๋ฌด ์์ฉ ์์๋ค.
๊ฒฐ๊ตญ ๋ฒ์ ๋ฌธ์ ..
2. ์์ธ ๋ถ์
ํ๋ก์ ํธ์ build.gradle์ ๋ณด๋ฉด MyBatis Starter ๋ฒ์ ์ด ๋ค์๊ณผ ๊ฐ์๋ค.
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.1'
๋ฌธ์ ๋ Spring Boot ๋ฒ์ ๊ณผ์ `ํธํ์ฑ`์ด๋ค.
- 3.0.1 ๋ฒ์ ์ Spring Boot 3.0 ~ 3.4 ๋ฒ์์ ์ต์ ํ๋จ
- ํ์ฌ ํ๋ก์ ํธ๋ Spring Boot 3.5.5 → ์ต์ ๋ฒ์ ๊ณผ ๋ง์ง ์์ Bean ๋ฑ๋ก ๊ณผ์ ์์ ์ถฉ๋ ๋ฐ์
3. ๋ฒ์ ํธํํ
๊ณต์ ๋ฌธ์ ๊ธฐ์ค์ผ๋ก ์ ๋ฆฌํ Spring Boot ↔ MyBatis Starter ํธํ ๊ด๊ณ๋ ๋ค์๊ณผ ๊ฐ๋ค.
| Mybatis Spring Boot Starter | ํธํ Spring Boot ๋ฒ์ |
| 2.3.x ~ 2.4.x | Spring Boot 2.3 ~ 2.7 |
| 3.0.x (3.0.0 ~ 3.0.4) | Spring Boot 3.0 ~ 3.4 |
| 3.1.x | Spring Boot 3.1.x |
| 3.2.x | Spring Boot 3.2.x |
| 3.3.x ์ด์ | Spring Boot 3.3 ์ด์ (์ต์ ) |
4. ํด๊ฒฐ ๋ฐฉ๋ฒ
MyBatis Starter ๋ฒ์ ์ ์ต์ ์์ ๋ฒ์ (3.0.4)์ผ๋ก ์ฌ๋ฆฌ๋ฉด ํด๊ฒฐ๋๋ค.
dependencies {
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.4'
}
๊ทธ๋ฆฌ๊ณ `gradle clean build` ํ ๋ค์ ์คํํ๋ฉด ์ ์ ๋์ํ๋ค.
5.์ถ๊ฐ ๊ถ์ฅ ์ค์
Application.java์ @MapperScan์ ์ถ๊ฐํ๋ฉด Mapper ์ค์บ์ด ๋ ๋ช ํํด์ง๋ค.
@SpringBootApplication
@MapperScan("org.example.weeks.member.mapper")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
6. ์ ๋ฆฌ
- ์๋ฌ ๋ฉ์์ง: factoryBeanObjectType invalid (String ํ์ ๋ฌธ์ )
- ์์ธ: MyBatis Starter ๋ฒ์ ๊ณผ Spring Boot 3.5.5์ ํธํ์ฑ ๋ถ์ผ์น
- ํด๊ฒฐ: mybatis-spring-boot-starter:3.0.4๋ก ์ ๊ทธ๋ ์ด๋
๐ ๊ฒฐ๋ก : Spring Boot ๋ฒ์ ์ ์ฌ๋ฆฌ๋ฉด MyBatis Starter๋ ๋ฐ๋์ ์ต์ ๋ฒ์ ์ผ๋ก ๋ง์ถฐ์ค์ผ ํ๋ค.
'โ์๋ฌํด๊ฒฐ๋ชจ์' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| # net::ERR_BLOCKED_BY_ORB / WMS ์์ฒญ ์คํจ ํด๊ฒฐ๋ฐฉ๋ฒ (0) | 2025.10.31 |
|---|---|
| # Local DB ์ ์ ์๋จ(DB์ ์ ๋ฌดํ๋ก๋ฉ) ์๋ฌ - autovacuum ์์ ์๊ฐ ๋๋ฌด ์ค๋์ ์ ์์๋์ด ์ค์ง๋จ ํด๊ฒฐ๋ฐฉ๋ฒ (3) | 2025.10.14 |
| # GPT 502 bad gateway ํ์ ์์ธ, ํด๊ฒฐ๋ฐฉ๋ฒ (0) | 2025.09.04 |
| # 413 Content Too Large ์๋ฌ (3) | 2025.08.25 |
| # Unable to ping server at localhost:1099 (0) | 2025.06.10 |