고등어통조림
832
2019-07-22 15:08:50
5
191

Invalid bound statement (not found) 에러가 납니다.


이게 컨트롤러이고...


@RequestMapping(value="/kiosk/request_call", method= RequestMethod.POST,

consumes=  MediaType.APPLICATION_JSON_UTF8_VALUE, 

produces = "application/json; utf-8")

public @ResponseBody Object request_call(@RequestBody Map<String, String> InputData)

throws JSONException{

String time = timeService.requestTime();

String id = InputData.get("id");

String phoneNum = InputData.get("phoneNum");

log.info("request_call() , id: " + id);

log.info("request_call() , phoneNum: " + phoneNum);

// 1. 

// 해당 매장에 요청 고객번호로 유효한 예약접수가 있는지 여부

int count = callInfoService.request_call_is_available(id, phoneNum);

log.info("request_call() , request_call_is_available: " + count);


저 서비스를 불러올때 에러가 납니다...


매퍼는 이렇습니다

<select id="request_call_is_available" resultType="int">

 <![CDATA[

 select count(*)

from tbl_call

inner join tbl_Stores on tbl_Stores.S_INDEX = tbl_call.S_INDEX

where 

tbl_Stores.S_ID = #{storeId} and

tbl_call.C_CODE in(1,2,5,7,8,9,10) and

tbl_call.VISITOR_PHONE = #{phoneNum} and

tbl_call.IS_COMPLITE = 0;

]]>

 </select>


매퍼인터페이스

public int request_call_is_available(@Param("storeId") String storeId, @Param("phoneNum") String phoneNum);


서비스 인터페이스

public int request_call_is_available(String storeId, String phoneNum);



서비스쪽입니다

@Override

public int request_call_is_available(String storeId, String phoneNum) {

return callMapper.request_call_is_available(storeId, phoneNum);

}


-----------------------------------------------------------------------------------


에러는

20190722 14:58:57.166 - 2019-07-22 14:58:57.0 

20190722 14:58:57.167 - request_call() , id: sbc0014 

20190722 14:58:57.168 - request_call() , phoneNum: 010-1111-1111 

20190722 14:58:57.184 - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): kr.co.petit.mapper.CallMapper.request_call_is_available] with root cause 

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): kr.co.petit.mapper.CallMapper.request_call_is_available

at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:235)

at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:53)

at org.apache.ibatis.binding.MapperProxy.lambda$cachedMapperMethod$0(MapperProxy.java:62)

at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)

at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:62)

at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:57)

at com.sun.proxy.$Proxy87.request_call_is_available(Unknown Source)

at kr.co.petit.service.CallInfoServiceImpl.request_call_is_available(CallInfoServiceImpl.java:128)

at kr.co.petit.controller.Kiosk.request_call(Kiosk.java:808)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)

at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)

at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)

at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)

at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587)

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:748)


0
0
  • 답변 5

  • ShipJH
    1k
    2019-07-22 15:25:30

    resultType Intager 로 해보시겠어욤?

    1
  • 고등어통조림
    832
    2019-07-22 15:37:18

    네, 매퍼의 resultType 을 Integer로 바꾸니 잘 됩니다.


    대체 이유가 뭔가요? ㅠㅠ

    이젠 이유가 엄청 궁금해졌어요


    (그리고 혹시 몰라서 추가로...

    매퍼만 Integer 맞죠?

    나머지 서비스쪽은 다 int 그대로이구요)

    0
  • ShipJH
    1k
    2019-07-22 16:08:02

    네네 ^^


    0
  • ShipJH
    1k
    2019-07-22 16:12:06

    간단하게 예를들면   resultType이
    vo면 vo의 풀 패키지까지써주는 형태로쓰셨잖아요?(Typealies설정을 안하면)

    예를들면 , com.demo.vo

    패키지에 UserVo가있다고치면

    resultType = "com.demo.vo.UserVo"

    까지 쓰셨잖아여?

    사실 "java.lang.Integer" 로 쓰셔도 무방합니다. 다만 이거 타입엘리어스가 알아서 맞춰주는거 같고요.


    일단 int 는 자료형타입이고 Integer는 클래스형 타입이라고 생각하시면 될 것 같습니다 ^^.


    거의 뭐... 저도 자세히는모르고 알고있는 뇌피셜로만 한거라...

    구글링을 추천드립니다.


    1
  • 고등어통조림
    832
    2019-07-23 12:53:38 작성 2019-07-23 12:54:43 수정됨

    네, 답변 감사드립니다.


    그리고 저 에러는 제가 조인하고 가져오거나 조건걸때 없는 컬럼을 써서 에러가 난거였어요

    0
  • 로그인을 하시면 답변을 등록할 수 있습니다.