๐Ÿ“Œ 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 ๊ตฌ๋ฌธ์˜ ์ปฌ๋Ÿผ ๋ฐ ๊ฐ’์˜ ๊ฐœ์ˆ˜ ์ผ์น˜ ํ™•์ธ

 

 

 

 

 

 

 

 

 

 

+ Recent posts