IntelliJ IDEA 开发Spring-mvc +mybits 项目时,启动tomcat后浏览器发送请求后收到了500服务器错误,错误如下:
我们提供的服务有:成都网站建设、做网站、微信公众号开发、网站优化、网站认证、滨湖ssl等。为成百上千家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的滨湖网站制作公司
HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.creditease.proxymanager.dao.ProxyInfoDAO.getProxyInfo
type Exception report
message Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.creditease.proxymanager.dao.ProxyInfoDAO.getProxyInfo
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.creditease.proxymanager.dao.ProxyInfoDAO.getProxyInfo
org.springframework.web.servlet.FrameworkServlet.proce***equest(FrameworkServlet.java:982)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.creditease.proxymanager.dao.ProxyInfoDAO.getProxyInfo
网上搜了一下,问题出在没找到Mapper XML 文件
经过多次尝试发现出现这个问题的原因在于mybatis逆向生成mapper接口和mapper.xml文件放在了同一个文件夹中,在编译打包时没法加载mapper.xml文件。
方式一:
src/main/java
**/*.properties
**/*.xml
false