开发中遇到下面问题,网上的方法都试过了,就是找不出原因,请大神们指教一下!
报错信息。
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.numberone.xr.mapper.JfmxMapper.insertJfmx
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:227)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:49)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
at com.sun.proxy.$Proxy132.insertJfmx(Unknown Source)
at com.numberone.xr.service.impl.JfmxServiceImpl.insertJfmx(JfmxServiceImpl.java:61)
at com.numberone.web.controller.xr.JfmxController.addSave(JfmxController.java:247)
at com.numberone.web.controller.xr.JfmxController$$FastClassBySpringCGLIB$$fd5f1add.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:55)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at com.numberone.web.controller.xr.JfmxController$$EnhancerBySpringCGLIB$$e8366a50.addSave(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
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.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
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:107)
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:107)
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:107)
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:107)
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:199)
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:791)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
网上方法都用了。
1.检查xml文件所在package名称是否和Mapper interface所在的包名 正确。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.numberone.xr.mapper.JfmxMapper">
<resultMap type="Jfmx" id="JfmxResult">
<result property="iD" column="ID" />
<result property="userID" column="UserID" />
<result property="username" column="Username" />
<result property="subTime" column="sub_time" />
<result property="deptname" column="deptname" />
<result property="deleteFlag" column="delete_flag" />
<result property="source" column="source" />
<result property="score" column="Score" />
<result property="deptId" column="deptId" />
<result property="comment" column="comment" />
<result property="createByID" column="createByID" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateByid" column="update_byID" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectJfmxVo">
select ID, UserID, Username, sub_time, deptname, delete_flag, source, Score, deptId, comment, createByID, create_by, create_time, update_byID, update_by, update_time from jfmx
</sql>
<select id="selectJfmxList" parameterType="Jfmx" resultMap="JfmxResult">
<include refid="selectJfmxVo"/>
<where>
<if test="iD != null "> and ID = #{iD}</if>
<if test="userID != null and userID != '' "> and UserID = #{userID}</if>
<if test="username != null and username != '' "> and Username = #{username}</if>
<if test="subTime != null "> and sub_time = #{subTime}</if>
<if test="deptname != null and deptname != '' "> and deptname = #{deptname}</if>
<if test="deleteFlag != null "> and delete_flag = #{deleteFlag}</if>
<if test="source != null "> and source = #{source}</if>
<if test="score != null "> and Score = #{score}</if>
<if test="deptId != null and deptId != '' "> and deptId = #{deptId}</if>
<if test="comment != null and comment != '' "> and comment = #{comment}</if>
<if test="createByID != null and createByID != '' "> and createByID = #{createByID}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateByid != null and updateByid != '' "> and update_byID = #{updateByid}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
</where>
</select>
<select id="selectJfmxById" parameterType="Integer" resultMap="JfmxResult">
<include refid="selectJfmxVo"/>
where ID = #{iD}
</select>
<insert id="insertJfmx" parameterType="Jfmx">
insert into jfmx
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="iD != null ">ID,</if>
<if test="userID != null and userID != '' ">UserID,</if>
<if test="username != null and username != '' ">Username,</if>
<if test="subTime != null ">sub_time,</if>
<if test="deptname != null and deptname != '' ">deptname,</if>
<if test="deleteFlag != null ">delete_flag,</if>
<if test="source != null ">source,</if>
<if test="score != null ">Score,</if>
<if test="deptId != null and deptId != '' ">deptId,</if>
<if test="comment != null and comment != '' ">comment,</if>
<if test="createByID != null and createByID != '' ">createByID,</if>
<if test="createBy != null and createBy != '' ">create_by,</if>
<if test="createTime != null ">create_time,</if>
<if test="updateByid != null and updateByid != '' ">update_byID,</if>
<if test="updateBy != null and updateBy != '' ">update_by,</if>
<if test="updateTime != null ">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="iD != null ">#{iD},</if>
<if test="userID != null and userID != '' ">#{userID},</if>
<if test="username != null and username != '' ">#{username},</if>
<if test="subTime != null ">#{subTime},</if>
<if test="deptname != null and deptname != '' ">#{deptname},</if>
<if test="deleteFlag != null ">#{deleteFlag},</if>
<if test="source != null ">#{source},</if>
<if test="score != null ">#{score},</if>
<if test="deptId != null and deptId != '' ">#{deptId},</if>
<if test="comment != null and comment != '' ">#{comment},</if>
<if test="createByID != null and createByID != '' ">#{createByID},</if>
<if test="createBy != null and createBy != '' ">#{createBy},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="updateByid != null and updateByid != '' ">#{updateByid},</if>
<if test="updateBy != null and updateBy != '' ">#{updateBy},</if>
<if test="updateTime != null ">#{updateTime},</if>
</trim>
</insert>
<update id="updateJfmx" parameterType="Jfmx">
update jfmx
<trim prefix="SET" suffixOverrides=",">
<if test="userID != null and userID != '' ">UserID = #{userID},</if>
<if test="username != null and username != '' ">Username = #{username},</if>
<if test="subTime != null ">sub_time = #{subTime},</if>
<if test="deptname != null and deptname != '' ">deptname = #{deptname},</if>
<if test="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
<if test="source != null ">source = #{source},</if>
<if test="score != null ">Score = #{score},</if>
<if test="deptId != null and deptId != '' ">deptId = #{deptId},</if>
<if test="comment != null and comment != '' ">comment = #{comment},</if>
<if test="createByID != null and createByID != '' ">createByID = #{createByID},</if>
<if test="createBy != null and createBy != '' ">create_by = #{createBy},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="updateByid != null and updateByid != '' ">update_byID = #{updateByid},</if>
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
</trim>
where ID = #{iD}
</update>
<delete id="deleteJfmxById" parameterType="Integer">
delete from jfmx where ID = #{iD}
</delete>
<delete id="deleteJfmxByIds" parameterType="String">
delete from jfmx where ID in
<foreach item="iD" collection="array" open="(" separator="," close=")">
#{iD}
</foreach>
</delete>
</mapper>
其他mapper有问题没?先去调他再看看是否报错,然后建个空的在看看,一点点排查咯,还有改名子啥的咯
<pre><span><resultMap </span><span>id</span><span>="BaseResultMap" </span><span>type</span><span>="com.java.alibaba.bind.Dongcidaci"</span><span>>,试一下这样</span></pre>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。