728x90
반응형
에러 메시지
HTTP 상태 500 – 내부 서버 오류
타입 예외 보고
메시지 Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='id', mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type: 1111
설명 서버가, 해당 요청을 충족시키지 못하게 하는 예기치 않은 조건을 맞닥뜨렸습니다.
예외
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='id', mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type: 1111
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
javax.servlet.http.HttpServlet.service(HttpServlet.java:656)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
...
1. 원인
비회원으로 로그인하여 제품 결제 화면으로 넘어갈 때 해당 에러 페이지가 발생하였다.
원인은 비회원 고객은 주문 시 order 테이블에 웹 아이디값이 NULL로 들어가졌기 때문이다.
일단 웹 아이디값은 회원, 비회원 상관없이 필수적으로 값이 있어야 한다.
그리고 데이터 타입이 VARCHAR여야 한다.
그러나 해당 조건이 모두 위배되었으니 당연히 에러가 날 수밖에 없었다.
회원의 경우, 회원 고유의 웹 아이디값이 주문 테이블에 그대로 들어가지니 상관없지만
비회원의 경우, 웹 아이디값이 들어가지 않아 예외가 발생했다.
2. 해결
비회원으로 로그인하여 주문할 때 주문 테이블에 웹 아이디의 값을 '비회원'인 varchar 형식으로 들어가게끔 수정하였다.
컨트롤러에서 비회원 로그인 시 웹 아이디 값을 '비회원'으로 DTO에 값을 세팅해주는 코드를 추가하였다.
728x90
반응형