springBoot集成mybatis出现的问题
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.4.1.RELEASE)
2018-06-21 16:50:08.096 INFO 15784 --- [ restartedMain] com.springboot.mybatis.App : Starting App on USERCHI-70MRA0S with PID 15784 (H:\zixidaima\springBoot\springBoot-mybatis\target\classes started by Administrator in H:\zixidaima\springBoot\springBoot-mybatis)
2018-06-21 16:50:08.098 INFO 15784 --- [ restartedMain] com.springboot.mybatis.App : No active profile set, falling back to default profiles: default
2018-06-21 16:50:08.174 INFO 15784 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot[email protected]18232275: startup date [Thu Jun 21 16:50:08 CST 2018]; root of context hierarchy
2018-06-21 16:50:08.667 WARN 15784 --- [ restartedMain] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.springboot.mybatis.*]' package. Please check your configuration.
2018-06-21 16:50:08.756 WARN 15784 --- [ restartedMain] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.springboot.mybatis]' package. Please check your configuration.
2018-06-21 16:50:09.069 INFO 15784 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$7cfee0c6] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-06-21 16:50:09.520 INFO 15784 --- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2018-06-21 16:50:09.529 INFO 15784 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service Tomcat
2018-06-21 16:50:09.530 INFO 15784 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.5
2018-06-21 16:50:09.611 INFO 15784 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-06-21 16:50:09.611 INFO 15784 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1439 ms
2018-06-21 16:50:09.723 INFO 15784 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2018-06-21 16:50:09.726 INFO 15784 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-06-21 16:50:09.726 INFO 15784 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-06-21 16:50:09.727 INFO 15784 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-06-21 16:50:09.727 INFO 15784 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-06-21 16:50:09.753 WARN 15784 --- [ restartedMain] 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 'userService': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean found for dependency [com.springboot.mybatis.UserMapper]: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2018-06-21 16:50:09.755 INFO 15784 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service Tomcat
2018-06-21 16:50:09.763 WARN 15784 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
2018-06-21 16:50:09.769 INFO 15784 --- [ restartedMain] utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-06-21 16:50:09.830 ERROR 15784 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field userMapper in com.springboot.mybatis.UserService required a bean of type 'com.springboot.mybatis.UserMapper' that could not be found.
Action:
Consider defining a bean of type 'com.springboot.mybatis.UserMapper' in your configuration.
出现的原因:
解决方法: