seorinha / Mountain

0 stars 0 forks source link

즐겨찾기 (bookmark) 구현 #18

Open seorinha opened 10 months ago

seorinha commented 10 months ago

mountain-list-view 화면의 별 아이콘을 누르면 bookmark에 mtId로 저장이 되도록 구현하는 과정에서

Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: ""]

seorinha commented 7 months ago

There was an unexpected error (type=Internal Server Error, status=500). nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 50 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 50

console 2024-02-02 14:51:15,695 DEBUG [com.project.mountain.mapper.MountainMapper.selectMountain] <== Total: 50 2024-02-02 14:51:15,701 ERROR [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet]] Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 50] with root cause org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 50

->mountain은 list로 이루어져 있지만 하나만 가져올 수 있도록 되어있어 에러 발생

-> 즐겨찾기에 mountain을 뿌리는 코드를 mountain -> List<Mountain> 으로 수정