boot项目找不到注册的mapper

刚刚开始学spring boot,用STS搭建了一个boot项目,
dao层的mapper接口继承了JpaRepository,service层调用findAll(),
controller层调用service的findAll(),
用STS启动时,报如下错误
图片说明
但是用eclipse启动就不报错,
有大佬知道为什么吗?

5个回答

启动类里面加mapper扫描配置了吗?

你应该吧你的配置弄上来让大家来看!

--------------------我的配置,你借鉴一下-----------------------------------
Spring公共配置

<!-- 使用annotation 自动注册bean,并检查@Required,@Autowired的属性已被注入 -->
<context:component-scan base-package="com.ronglian.jspt">
    <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>

<!-- 连接池配置 -->
<bean id="environmentVariablesConfiguration" class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
    <property name="algorithm" value="PBEWithMD5AndDES" />
    <property name="password" value="Z5EXBWDP8QXT6UAY7B8G" />
</bean>
<bean id="configurationEncryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
    <property name="config" ref="environmentVariablesConfiguration" />
</bean>
<bean id="propertyConfigurer" class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer">
    <constructor-arg ref="configurationEncryptor" />
    <property name="locations">
        <list>
            <value>classpath:db.properties</value>
        </list>
    </property>
</bean>
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
    <property name="driverClass">
        <value>${datasource.driverClass}</value>
    </property>
    <property name="jdbcUrl">
        <value>${datasource.jdbcUrl}</value>
    </property>
    <property name="user">
        <value>${datasource.user}</value>
    </property>
    <property name="password">
        <value>${datasource.password}</value>
    </property>
    ....其他属性省略
</bean>

<!-- Jpa Entity Manager 配置 -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
    <property name="packagesToScan" value="com.ronglian.jspt"/>
    <property name="jpaProperties">
        <props>
            <prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
            <prop key="hibernate.show_sql">true</prop>
        </props>
    </property>
</bean>

<bean id="hibernateJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
    <property name="databasePlatform">
        <bean factory-method="getDialect" class="com.ronglian.jspt.quartz.utils.HibernateDialect">
            <constructor-arg ref="dataSource"/>
        </bean>
    </property>
</bean>

<!-- Spring Data Jpa配置, 扫描base-package下所有继承于Repository<T,ID>的接口 -->
<jpa:repositories base-package="com.ronglian.jspt" transaction-manager-ref="transactionManager" entity-manager-factory-ref="entityManagerFactory"/>


<!-- 事务管理器配置, Jpa单数据源事务 -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
    <property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>

<!-- 使用annotation定义事务 -->
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />

<!-- 定义aspectj -->
<aop:aspectj-autoproxy proxy-target-class="true"/>

启动类里的扫描包的注解是 @MapperScan吗,我这里加不上去
图片说明
以下是我的工程目录:
图片说明
pom:
图片说明
启动类:
图片说明
配置文件application.properties里就配置了数据源

启动类没有基础springboot的加载,改为
public class DemoApplication extends SpringBootServletInitializer{}

@一只小T 加上去之后报错
现在解决了,如下,把boot版本从1.5.7换成1.5.6就运行成功了
图片说明
但是还是不知道具体原因,有大佬知道吗?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Spring Boot 找不到Mapper文件,直接运行时异常
没有好好学SpringBoot直接就用代码出现一系列解决不了的错误显示报错信息如下: *************************** APPLICATION FAILED TO START *************************** Description: Field mapper in com.demo.service.impl.UserServiceImpl requi...
Spring Boot项目通用功能之《通用Mapper》
前言 接下来这几篇文章中我们主要说说,在我们的项目中会使用哪些通用的功能,例如:通用Mapper(mybatis框架的)、通用service和分页功能等等,这些通用功能的使用会大大降低我们的开发时间,也会让我们的代码变得更加有规范更加合理,今天这篇文章我们说说怎么使用通用mapper。 通用mapper简介 通用mapper是一个国人编写的工具jar,它可以极其方便的做单表增删改查(使用
spring-boot在启动项目时找不到Mapper。
最近在做spring-boot项目的时候出现了找不到mapper接口的问题,控制台打印如下: *************************** APPLICATION FAILED TO START *************************** Description: A component required a bean of type 'com.ruifeng.dem...
SpringCloud分布式项目找不到mapper文件
Invalid bound statement (not found): com.cyclothes.mapper.CyClothesTypeMapper.selectByExample 一直找不到mapper 我就纳了闷了. 直接上图 搞定.... ---------------------------------------------------------...
mybatis找不到mapper映射文件
mybatis默认找的映射文件路径是src/main/resources,如果放在src/main/java下的一个包中,则需要在该项目的pom.xml文件中加入: &amp;amp;amp;lt;build&amp;amp;amp;gt; &amp;amp;amp;lt;resources&amp;amp;amp;gt; &amp;amp;amp;lt;resource&amp;amp;amp;gt; &amp;amp;amp;lt;directory&amp;amp;amp;gt;s
MyBatis找不到mapper文件
用的Idea,在写MyBatis时,测试发现有以下的报错信息 Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource dao/PersonMapper.xml 即找不到mapper文件 解决办法:https://blog.csdn.net/qq_33591903/arti...
Global Mapper注册
Global Mapper 12注册码 很好用的
Mapper映射注册
<mappers> <!-- 注册userMapper.xml文件, userMapper.xml位于me.gacl.mapping这个包下,所以resource写成me/wangzai/mapping/userMapper.xml--> <mapper resource="com/wangzai/mapping/userMapper.xml"/>
spring boot项目启动报错,找不到XXX类
不是很懂csdn如何提问,所以先记录下来,也希望知道解决方案的能给点提示。问题描述:    新建一个spring boot工程,并且有如下项目:    项目一:cust-service,有启动类CustApplication、有依赖一个base服务(base没有application类,是以jar包形式提供一些基础代码)、还有调用一个feign的client服务,还有依赖并调用redis-serv...
Spring Boot框架搭建与学习 1.搭建项目、自动生成Mapper
Spring Boot版本为1.5 第一节 1.spring boot解决了问题(优点):xml配置简化、编码、监听功能变强 第二节 springboot与springcloud的java版本使用1.8,依赖关系:https://blog.csdn.net/qq_16946803/article/details/87886851 1.介绍springboot结构 2.创建一个ht...
spring boot 项目重新搭建----------分页及通用mapper配置
1.在resources下创建favicon.ico(访问的时候会有自己的小图标) 2.在yml中@var@   #当前服务器版本 自动读取MAVEN信息 @var@格式 version: @project.version@ 3配置分页插件 导入依赖 &amp;lt;!--分页插件--&amp;gt; &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;com.githu...
Spring boot聚合项目mapper接口无法注入问题
错误异常 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDel...
【MyBatis】MyBatis找不到mapper文件
                                  MyBatis找不到mapper文件 用的Idea,在写MyBatis时,测试发现有以下的报错信息 Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource dao/PersonMapper.xml ...
springboot+mybatis找不到定义的Mapper对象
Field accountMapper in com.XXX.XXXService required a bean of type 'com.XXX.dao.AccountMapper' that could not be found. Action: Consider defining a bean of type 'com.XXX.dao.AccountMapper' in your con...
ssm+maven 出现找不到mapper的异常
src/main/java     **/*.properties   **/*.xml     false       service层调mapper内部方法时会出现找不到mapper的异常。
MyBatis源码通~Mapper注册
Mapper接口注册 /mapper节点解析完成后,通过命名空间绑定 mapper 接口,这样才能将映射文件中的 SQL 语句和 mapper 接口中的方法绑定在一起(记录在Configuration的MapperRegistry mapperRegistry),后续即可通过调用 mapper 接口方法执行与之对应的 SQL 语句。 1、入口 XMLMapperBuilder.bindMapper...
Spring Boot 整合Mybatis 之 Mapper插件(自动生成XML及Mapper代码)
pom文件 主要代码 &amp;lt;dependencies&amp;gt; &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;mysql&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;mysql-connector-java&amp;lt;/artifactId&amp;gt; &amp;lt;/depe...
maven编译后启动项目提示找不到mapper对应的xml文件
因为maven编译的时候没有将xml文件build到target目录中, 解决办法: 在该模块pom.xml文件中,添加扫描xml的build标签;因为build由maven插件执行,所以此配置配在maven的pom.xml文件中; 其中&amp;lt;directory&amp;gt;中的路径写自己xml文件的所在位置,一般就写class路径;由于此处配置后就不会再扫描resources包下的xml和其他...
解决idea创建ssm项目找不到mybatis的mapper的xml文件问题
之前搞了有一年多的大数据,web好多东西有点忘记了,最近准备重新看一下,自己用idea建了个项目试试,碰到个问题,后来仔细想了下找到了解决办法,这里记录一下。 创建一个maven web工程,项目结构如下 就是想实现一个简单的查询功能,把spring mvc、spring 和 mybatis整合起来。 部署并启动项目后,总是报一个错误:org.apache.ibati
Spring Boot,找不到数据库?
今天在实现一个小demo的时候,被一个找不到数据库的问题坑了好久啊啊啊啊啊啊,记录一下,以后做事情一定要认真;另外,知识的掌握一定要扎实牢靠。    1、看起来很简单的问题    简单描述一下背景:    使用Spring boot创建一个服务提供者,选取了web,jpa,h2等进行简单支持。    由于是个demo级别的,所以也没有配置本地h2,只是配置了建表语句和数据sql,但就是这几
spring boot 短信服务(注册)
目录 spring boot构建短信微服务 写一个activeMQ的监听类 注册帐号示例 前言 这里是使用阿里的阿里大于短信平台做例子,需要注册帐号 目的是防止你注册一堆小号 spring boot基础https://blog.csdn.net/yzj17025693/article/details/89577324 spring jms(activeMQ)进阶https:/...
spring boot 注册类型转换
spring boot注册一个全局的类型转换器,转换表单中的string 到Date [code=&quot;java&quot;]@Configuration public class WebConfig { // IMPORTANT: keep the order private final static String[] dateFormats = { ...
spring boot 动态数据源切换+通用mapper配置
最近因为项目可能要用到多数据源,所以最近研究了下动态切换数据源,在spring2.0以后增加了AbstractRoutingDataSource 来实现对数据源的操作。 对数据源进行切换 继承扩展AbstractRoutingDataSource这个抽象类 ,根据提供的键值切换对应的数据源,下面我们来看下这个类 public abstract class AbstractRoutingDat...
spring boot扫描多个mapper文件夹
1、今天在做项目的时候报错(Invalid bound statement (not found): com.reportSystem.dao.ReprotSystemDao.findTotalDrawCount) 2、最后排查问题,总以为是contorller或者service层出的问题,仔细比较过后发现还是一样的效果,怎么改都报错。 3、最后发现是配置文件扫描mapper文件夹下的mapp...
Spring boot整合通用mapper简单案例
通用mapper 可以极大的方便开发人员进行ORM,提供极其方便的单表增删改查。 什么是通用mapper,一句话简单说,它就是个辅助mybatis极简单表开发的组件。它不是为了替代mybatis,而是让mybatis的开发更方便。 1.首先创建mapper接口(这里是在spring boot上进行整合)。 2.在pom文件李里面引入“通用mapper” 注意:引入之后通用mapper会覆...
ssm+maven项目配置mapper 自动生成
自己搭了一个ssm+maven项目,想要测试,但是那些mybatis 配置文件写写很烦,然后就自己百度上查了一下,弄了个自动生成。直接帮你生成dao层和model类。觉得很好用,就记录一下。 步骤: 1、在pom文件中加入相应的插件依赖 <plugins> <plugin> <groupId>org.mybatis.generator
idea启用boot项目找不到或无法加载主类 com.xxx.xxx.xxx.Application
碰到这个问题的时候我以为是代码的问题,但是就只是更新了代码就出现了这个异常,但是这个项目的代码又没有被修改过, 然后我上网查找问题解决办法,都是说让我重新将maven clean install 一下,但是没有解决我的这个问题,然后我去git上看代码的时候发现.idea有人提交上去了 然后将idea文件删除后重新用idea打开这个项目即可解决 ...
IDEA 快速创建项目Spring boot项目缺找不到spring Initializr
搜了很多文章都是打开setting---&amp;gt;plugins---&amp;gt;然后搜索Spring boot---&amp;gt;然后安装Spring boot插件,估计是老版本的IDEA的操作吧,我用的2017.03版本根本找不到,后来就把所有的Spring boot搜出来的插件都安装测试,后来发现新版本应该是改了, 解决 办法就是去plugins里边搜Spring Assistant,安装完后重启id...
InteliJ IDEA创建spring boot项目时找不到链接入口
今天新换了个电脑用的最新的Idea2018.3.5,但是这个时候有一个问题,就是新建项目是没有springboot快速创建接口, 知道是缺少插件但是直接在plugins中搜索找不到Springboot,新版的idea是换成了Spring Assistant,在plugins中搜索安装即可,我的是因为自己安装了,但是没有勾选,所以找不到!附上两张图 ...
idea spring boot项目导入提示找不到主类
在打开后,配置运行项目。 需要填写好vm option, workingdirectory 还有use classpath of module,这个模块是选择的主类所在的模块。在一个项目中会有多个模块,这个不要选错
spring boot mavne项目报类找不到的错误
错误如下:rn[img=https://img-bbs.csdn.net/upload/201702/20/1487581951_752879.png][/img]rnrn详细信息:rnrn . ____ _ __ _ _rn /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \rn( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \rn \\/ ___)| |_)| | | | | || (_| | ) ) ) )rn ' |____| .__|_| |_|_| |_\__, | / / / /rn =========|_|==============|___/=/_/_/_/rn :: Spring Boot :: (v1.3.3.RELEASE)rnrn16:57:12.828 [main] INFO com.aladdin.Application - Starting Application on WINDOWS-SSG78E8 with PID 8980 (E:\WorkSpace\aladdin_workspace\dev\aladdin-sketchup\sketchup-rest\target\classes started by Administrator in E:\WorkSpace\aladdin_workspace\dev\aladdin-sketchup\sketchup-rest)rn16:57:12.833 [main] INFO com.aladdin.Application - The following profiles are active: devrn16:57:12.876 [main] INFO o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@77097192: startup date [Mon Feb 20 16:57:12 CST 2017]; root of context hierarchyrn16:57:12.938 [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 5.2.4.Finalrn16:57:14.561 [main] ERROR o.s.boot.SpringApplication - Application startup failedrnjava.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer due to com/aliyun/openservices/ons/api/order/MessageOrderListener not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)rn at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:55)rn at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102)rn at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:178)rn at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140)rn at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)rn at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:333)rn at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)rn at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)rn at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)rn at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)rn at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)rn at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)rn at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)rn at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)rn at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)rn at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)rn at com.aladdin.Application.main(Application.java:19)rnCaused by: java.lang.NoClassDefFoundError: com/aliyun/openservices/ons/api/order/MessageOrderListenerrn at java.lang.Class.getDeclaredMethods0(Native Method)rn at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)rn at java.lang.Class.getDeclaredMethods(Class.java:1860)rn at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:609)rn at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:521)rn at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:507)rn at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:567)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:683)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:627)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)rn at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1445)rn at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:975)rn at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:289)rn at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.addBeanType(BeanTypeRegistry.java:278)rn at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:259)rn at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:182)rn at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:171)rn at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:139)rn at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:113)rn at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)rn ... 17 common frames omittedrnCaused by: java.lang.ClassNotFoundException: com.aliyun.openservices.ons.api.order.MessageOrderListenerrn at java.net.URLClassLoader$1.run(URLClassLoader.java:366)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:355)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:354)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:425)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:358)rn ... 37 common frames omittedrn......rnrn这个类是存在的,代码也不报错,也clean install了,也update 了,可就是一直报这个错,实在看不出来哪的问题,大伙帮忙看看。rnrn[img=https://img-bbs.csdn.net/upload/201702/20/1487582209_101935.png][/img]rnrn项目中这个类也明明存在。
找不到已注册的控件
我自己编写的控件,在我重装了系统重装了vc之后,运行成功,注册成功,可是我用vc自带的容器测试时,为什么找不到已经注册的控件呢??谢谢大家回答
Mybatis在IDEA中找不到mapper映射文件
刚开始在IDEA中做用Mybatis查数据库中的数据时,报mapper映射文件找不到,害的我检查了好几次配置的路径是不是正确,但是看了好几遍都没有发现有拼写错误。(我记得以前在eclipse中这样写是没问题的)&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt; &amp;lt;!DOCTYPE configuration PUBLIC &quot;-//myba...
invalid bound statement找不到mapper映射文件解决方法
修改taotao-manager-mapper的pom文件 在pom文件中添加如下内容: &lt;!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 --&gt; &lt;build&gt; &lt;resources&gt; &lt;resource&gt; &...
springboot整合mybatis-plus找不到mapper文件
各位大佬springboot整合mybatis-plus报错,按照网上说法排除了以下几个原因:rn1.application.properties的配置mapper-locations路径正确rn2.datasource配置文件中加@MapperScanrn3.mapper.xml里的namespace配置正确rn但还是没有解决。rn以下是控制台报错:rn[code=text]org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.springboot.learn.mapper.UserMapper.insertrn at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:225) ~[mybatis-3.4.4.jar:3.4.4]rn at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:48) ~[mybatis-3.4.4.jar:3.4.4]rn at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65) ~[mybatis-3.4.4.jar:3.4.4]rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58) ~[mybatis-3.4.4.jar:3.4.4]rn at com.sun.proxy.$Proxy63.insert(Unknown Source) ~[na:na]rn at com.springboot.learn.controller.UserController.demo(UserController.java:36) ~[classes/:na]rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_152]rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_152]rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152]rn at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152]rn at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) ~[druid-1.1.6.jar:1.1.6]rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE]rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_152]rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_152]rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.34.jar:8.5.34]rn at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152][/code]rn
SpringBoot聚合工程找不到mapper文件
考虑一下是不是Maven打Jar包的时候有没有把XML文件打进jar包
hadoop中有时运行会提示mapper找不到
当hadoop运行时出现mapper找不到,或者不存在:可以把该java文件打jar包 比如:运行WorldCount.java文件时,出现上述错误,则可以将该Java文件export出jar格式,再把该jar包buildpath ----------------------------------------------------------------------------------
解决淘淘商城找不到mapper映射文件的错误
在复习做淘淘商城的项目的时候,搭建完ssm框架并用一个简单返回商品json数据的例子测试框架。但运行起来总是报错: 这里检查配置文件和逆向工程生成都有mapper文件,所以就去workspace下去找target之下的mapper包中有没有mapper文件。结果发现只有mapper类没有mapper文件。这是因为taotao-manager-mapper的pom.xml文件中默认
Spring-Mybatis框架找不到Mapper下的方法的问题
小弟想学习一下Mybatis,于是照着这篇大神的博文依样画葫芦,但是每一步都几乎相同了,最后总会报这个错rn[code=java]org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.gcoreinc.dao.BoxDetailMapper.selectBoxDetailByBoxId[/code]rn先贴一下我的代码,编辑器用的Intellijrn项目目录如下:rnrnspring.xmlrn[code=xml]rnrnrn rn rn rn rn[/code]rnrnspring-mybatis.xmlrn[code=xml]rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rnrn rn rnrn[/code]rnMapper.xmlrn[code=xml]rnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn SELECT * FROM BOX_DETAILrn WHERE BOX_ID = #boxIDrn rn[/code]rnrnMapper.javarn[code=java]package com.gcoreinc.dao;rnrnimport com.gcoreinc.domain.BoxDetail;rnrnimport java.util.List;rnrnpublic interface BoxDetailMapper rn public List selectBoxDetailByBoxId(String boxId);rnrn[/code]rn最后是测试类,Service里面只有一个方法,就不用贴了吧rn[code=java]package com.gcoreinc.service;rnrnimport com.gcoreinc.domain.BoxDetail;rnimport org.junit.Test;rnimport org.junit.runner.RunWith;rnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.test.context.ContextConfiguration;rnimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;rnrnimport java.util.List;rnrn@RunWith(SpringJUnit4ClassRunner.class)rn@ContextConfiguration(locations = "classpath:spring.xml","classpath:spring-mybatis.xml")rnpublic class BoxDetailServiceTest rnrn @Autowiredrn private BoxDetailService service;rnrn @Testrn public void getBoxDetailByBoxIdTest()rn List boxDetailList = service.getBoxDetailByBoxId("VSH130403393");rn for (BoxDetail boxDetail : boxDetailList) rn System.out.println(boxDetail);rn rn rnrn[/code]rn运行测试方法之后就会报错,确实不知道什么地方配置错了或怎么样,请各路大神帮忙看看,多谢多谢[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/15.gif][/img]
SpringBoot集成MyBatis,显示找不到Mapper
*************************** APPLICATION FAILED TO START *************************** Description: Field tblUserMapper in com.example.springboot_mybatisdemo.service.Impl.TblUserServiceImpl required a...
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法