【spring boot】mybatis启动报错:Consider defining a bean of type 'com.newhope.interview.dao.UserMapper' in your configuration.

启动报错:

2018-02-24 22:41:00.442  WARN 2952 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userController‘: Unsatisfied dependency expressed through field ‘userService‘; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userServiceImpl‘: Unsatisfied dependency expressed through field ‘userMapper‘; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.newhope.interview.dao.UserMapper‘ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2018-02-24 22:41:00.444  INFO 2952 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2018-02-24 22:41:00.465  INFO 2952 --- [           main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug‘ enabled.
2018-02-24 22:41:00.564 ERROR 2952 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field userMapper in com.newhope.interview.service.impl.UserServiceImpl required a bean of type ‘com.newhope.interview.dao.UserMapper‘ that could not be found.

Action:

Consider defining a bean of type ‘com.newhope.interview.dao.UserMapper‘ in your configuration.

解决方案:

https://www.cnblogs.com/JealousGirl/p/bean.html

====================================

未完结

【spring boot】mybatis启动报错:Consider defining a bean of type 'com.newhope.interview.dao.UserMapper' in your configuration.

原文地址:https://www.cnblogs.com/sxdcgaq8080/p/8467965.html

时间: 2024-10-18 03:33:49

【spring boot】mybatis启动报错:Consider defining a bean of type 'com.newhope.interview.dao.UserMapper' in your configuration.的相关文章

spring cloud gateway网关启动报错:No qualifying bean of type 'org.springframework.web.reactive.DispatcherHandler'

网关配置好后启动报错如下: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servletEndpoint

Sping Cloud项目启动报A component required a bean of type 'com.tianyan.bbc.dao.SecurityUserBaseMapper' that could not be found.

项目构建正常,启动和Debug报以下错误: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2018-12-14 09:49:32.038 [main] ERROR o.s.b.diagnostics.LoggingFailureAnalysisReporter - ***************************

IDEA下spring boot+fremarker启动报错would dispatch back to the current handler URL [/hello] again. Check your ViewResolver setup!

详细报错代码(ps:标题中写不下报错主要代码) javax.servlet.ServletException: Circular view path [hello]: would dispatch back to the current handler URL [/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default vie

关于spring boot项目启动报错问题

这次用了spring boot,项目在启动时报错,由于我用的是jdk 1.7 ,该项目默认的是jdk 1.8,所以要把下面这一系列配置改好才行.废话不多说,上图: 一看发现,项目环境没有配全,打开file->Project Structuer,找到Project ,把里面的jdk配置成你自己的. 还有Modules里面的的这几项: 然后找到file->setting-->Java Compiler 里面 这些都配置好才能起动main函数启动服务.

Spring Boot @Autowired无法注入类 Consider defining a bean of type

SpringBoot 装备默认规则是根据Application类所在的包位置从上到下扫描, 例如 com.seed.controller com.seed.service com.seed.dao 如果 Application在com.seed.controller 这个包下, 就会无法扫描 service dao, 所以可以看到 很多博客写的spring整合mybatis 都在一个包下. 如果把Application 放在com.seed下 就可以扫描到其子包 service dao 就这个小

spring boot 整合kafka 报错 Exception thrown when sending a message with key='null' and payload=JSON to topic proccess_trading_end: TimeoutException: Failed to update metadata after 60000 ms.

org.springframework.kafka.support.LoggingProducerListener- Exception thrown when sending a message with key='null' and payload='{"dataDts":["20180329","20180328","20180327","20180326","20180323"]

Spring Boot配置FastJson报错'Content-Type' cannot contain wildcard type '*'

https://www.cnblogs.com/xiaopotian/p/8654993.html 升级到最新版本的fastjson以后报的错,查了一下资料,发现 fastjson从1.1.41升级到1.2.28之后,请求报错:json java.lang.IllegalArgumentException: 'Content-Type' cannot contain wildcard type '*' 原因是在1.1.41中,FastJsonHttpMessageConverter初始化时,设置

shiro+spring boot+mybatis启动循环引用问题解决思路和方案

启动报错:Error creating bean with name 'dataSource': Requested bean is currently in creation: Is there an unresolvable circular reference? 翻译过来的意思就是:创建bean"dataSource"报错:需要的bean正在被创建:是否有一个没解决的循环依赖? 更通俗点的解释就是:因为循环依赖的问题导致"dataSource"这个bean无法

【原创】mybatis配置文件报错:The content of element type "configuration" must match "(properties>settings>typeAliases>typeHa...

最近使用mybatis,在mybatis的xml配置文件中总是会提示错误 The content of element type "configuration" must match "(properties>settings>typeAliases>typeHandlers>objectFactory>objectWrapperFactory>plugins>environments>mappers?)". 后来发现