启动tomcat以后报Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample错误(示例代

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了启动tomcat以后报Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample错误(示例代相关的知识,希望对你有一定的参考价值。

十月 01, 2017 2:56:38 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
十月 01, 2017 2:56:44 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [taotao-manager] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample] with root cause
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample
	at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
	at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
	at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
	at com.sun.proxy.$Proxy27.selectByExample(Unknown Source)
	at com.taotao.service.impl.ItemServiceImpl.geTbItemById(ItemServiceImpl.java:33)
	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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:267)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

  

找不到mapper映射文件,打开workspace工作空间以后,发现根本没有xml文件

解决办法:

修改pom文件,在其中加上如下代码:

 

<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->
	<build>
		<resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>


以上是关于启动tomcat以后报Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByExample错误(示例代的主要内容,如果未能解决你的问题,请参考以下文章

mybatismybatis访问报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)(代

Invalid bound statement (not found): com.example.demo.mapper.B18040208Mapper.search

在使用mybatis的selectFromExample时出现Invalid bound statement (not found)错误

eclipse tomcat启动项目报错:Invalid byte tag in constant pool: 19 jackson-core-2.10.1.jar/] for annotatio

项目报错:Invalid bound statement (not found):

TOMCAT 启动报错 INVALID CHARACTER FOUND IN METHOD NAME. HTTP METHOD NAMES MUST BE TOKENS