SSM错误集锦

        吃一堑长一智,然而我却经常在开发的途中犯了错,总是没去做好笔记,以至于总是遇到似曾相识的bug,以后不能再这样啦~~,一定要去记点东西啊,不然没个技术blog面试是没有优势的!

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.permission.dao.SysDeptMapper.countByNameAndParentIdorg.springframework.web.servlet.FrameworkServlet.processRequest(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)com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)



解决方案:https://blog.csdn.net/oMrLeft123/article/details/70239951,这是转载啊~~~~~,是这样声明吗?  这个可以解决一般错误了,然而我的错误是这样的:

 
    
        
        
        
    

        是的!mapperLocations被注释掉了···  貌似是最开始建项目的时候运行单元测试会报错,就想先暂时隐藏一下,然后后来正式玩的时候就GG了······  看来TODO的事情一定要少做····

        然而 Exeception永远不是单打独斗的,终于跑了起来,又来了新伙伴:

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.permission.dao.SysDeptMapper.map
	org.springframework.web.servlet.FrameworkServlet.processRequest(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)
	com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

幸好这个给了我一个具体的路径,然后去该mapper文件下找到了····

SSM错误集锦_第1张图片


改成如下,将parameterMap改成parameterType即可:

SSM错误集锦_第2张图片

原因如下:https://blog.csdn.net/a672489861/article/details/22897451,这是转载啊~~~~~,是这样声明吗?

紧接着,在执行一次批量更新的时候,又遇到这样的问题,come on``````````````

Apache Tomcat/8.0.48 - Error report 

HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException:

type Exception report

message Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException:

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.springframework.jdbc.UncategorizedSQLException: 
### Error updating database.  Cause: java.sql.SQLException: sql injection violation, multi-statement not allow : UPDATE sys_dept
            SET level = ?
            WHERE id = ?
         ; 
            UPDATE sys_dept
            SET level = ?
            WHERE id = ?
         ; 
            UPDATE sys_dept
            SET level = ?
            WHERE id = ?
         ; 
            UPDATE sys_dept
            SET level = ?
            WHERE id = ?
### SQL: UPDATE sys_dept             SET level = ?             WHERE id = ?          ;              UPDATE sys_dept             SET level = ?             WHERE id = ?          

查了下,由于连接数据库用的是druid,这是由于没有设置multiStatementAllow所致,解决方案如下:

https://blog.csdn.net/goldenfish1919/article/details/50600053,这是转载啊~~~~~,是这样声明吗?

我这边是直接加到数据库连接字符串后面了。

SSM错误集锦_第3张图片

唉 ,暂时就是这两个, 待续吧~~~~~~



你可能感兴趣的:(SSM错误集锦)