๐ 1. TypeMismatchException: ๋งคํผ XML์ ํ๋ผ๋ฏธํฐ ๋ถ์ผ์น
Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException
์์ธ
- .xml ํ์ผ์ <insert> ํ๊ทธ์์ parameterType์ด ์ค์ ์ ๋ฌ๋ ๊ฐ์ฒด์ ์ผ์นํ์ง ์์
ํด๊ฒฐ ๋ฐฉ๋ฒ
- ์ ๋ฌ๋๋ ๊ฐ์ฒด์ ํจํค์ง ๋ฐ ํด๋์ค๋ช ์ ์ ํํ๊ฒ ๊ธฐ์
- VO ํด๋์ค์ ํ๋์ MyBatis ๋งคํผ XML์ ํ๋ผ๋ฏธํฐ ํ์ ์ผ์น ํ์ธ
<insert id="insertOption" parameterType="com.myspace.vo.OptionVO">
๐ 2. BeanCreationException: Mapper ์์น ์ค๋ฅ
Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource
์์ธ
- mapperLocations ๊ฒฝ๋ก๋ฅผ ์๋ชป ์ง์ ํ์ ๋ ๋ฐ์
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mapperLocations" value="classpath:com/myspace/mapper/*.xml" />
</bean>
๐ 3. BeanCreationException: @RequestMapping ์ค๋ณต
org.springframework.beans.factory.BeanCreationException: Injection of autowired dependencies failed
java.lang.IllegalStateException: Ambiguous mapping found
์์ธ
- @RequestMapping์ ๋์ผํ URL์ ์ฌ์ฉํ๋ ๋ฉ์๋๊ฐ ์ฌ๋ฌ ๊ฐ ์กด์ฌํ ๋ ๋ฐ์
ํด๊ฒฐ ๋ฐฉ๋ฒ
- @RequestMapping("/example")์ @GetMapping, @PostMapping ๋ฑ์ผ๋ก ๊ตฌ๋ถ
- ๋ฉ์๋๋ณ๋ก ๊ณ ์ ํ URL์ ์ฌ์ฉํ์ฌ ์ค๋ณต์ ํผํจ
๐ 4. SQLException: ORA-00907: missing right parenthesis
bad SQL grammar []; nested exception is java.sql.SQLException: ORA-00907: missing right parenthesis
์์ธ:
- SQL ์ฟผ๋ฆฌ์์ **๊ดํธ( )**๋ **์ฝค๋ง(,)**๊ฐ ๋๋ฝ๋์์ ๋ ๋ฐ์
ํด๊ฒฐ ๋ฐฉ๋ฒ:
- ์ฟผ๋ฆฌ๋ฌธ์ ๋ค์ ํ์ธํ์ฌ ๊ดํธ์ ์ฝค๋ง์ ์ง์ ๋ง์ถค
- ํนํ INSERT, SELECT ๊ตฌ๋ฌธ์ ์ปฌ๋ผ ๋ฐ ๊ฐ์ ๊ฐ์ ์ผ์น ํ์ธ
'๋ฐฑ์๋ > Spring Boot' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Spring Boot] IntelliJ ์คํ๋ง ํ๋ก์ ํธ ์์ (0) | 2022.12.03 |
---|---|
[Spring Boot] ์คํ๋ง๋ถํธ - ๋ชฝ๊ณ ๋๋น ์ฐ๋ (0) | 2022.05.29 |
[Spring] git ignore (0) | 2021.07.07 |
[Spring] web.xml ํ๊ธ ์ธ์ฝ๋ฉ (0) | 2021.06.03 |
[Spring] DB(์ค๋ผํด) ์ฐ๋ (0) | 2021.06.02 |