'com.mooc.house.mapper.UserMapper' that could not be found
来源:3-4 数据访问层搭建-整合MyBatis

慕后端2037237
2018-04-19
最后还是跑不出来, 我都根据您的流程一直跑到最后,可是最后出现 UserMapper 问题
2018-04-18 16:55:33.492 INFO 5231 --- [ main] com.mooc.house.HouseApplication : Starting HouseApplication on C02SH69QG8WP.corp.proofpoint.com with PID 5231 (/Users/hli/Documents/HouseAgent/house/target/classes started by hli in /Users/hli/Documents/HouseAgent/house)
2018-04-18 16:55:33.496 INFO 5231 --- [ main] com.mooc.house.HouseApplication : No active profile set, falling back to default profiles: default
2018-04-18 16:55:33.539 INFO 5231 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6fe7aac8: startup date [Wed Apr 18 16:55:33 EDT 2018]; root of context hierarchy
2018-04-18 16:55:34.305 INFO 5231 --- [ main] org.eclipse.jetty.util.log : Logging initialized @1543ms to org.eclipse.jetty.util.log.Slf4jLog
2018-04-18 16:55:34.372 INFO 5231 --- [ main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8090
2018-04-18 16:55:34.374 INFO 5231 --- [ main] org.eclipse.jetty.server.Server : jetty-9.4.9.v20180320; built: 2018-03-20T08:21:10-04:00; git: 1f8159b1e4a42d3f79997021ea1609f2fbac6de5; jvm 1.8.0_131-b11
2018-04-18 16:55:34.477 INFO 5231 --- [ main] org.eclipse.jetty.server.session : DefaultSessionIdManager workerName=node0
2018-04-18 16:55:34.477 INFO 5231 --- [ main] org.eclipse.jetty.server.session : No SessionScavenger set, using defaults
2018-04-18 16:55:34.478 INFO 5231 --- [ main] org.eclipse.jetty.server.session : Scavenging every 600000ms
2018-04-18 16:55:34.483 INFO 5231 --- [ main] o.e.j.s.h.ContextHandler.application : Initializing Spring embedded WebApplicationContext
2018-04-18 16:55:34.483 INFO 5231 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 947 ms
2018-04-18 16:55:34.598 INFO 5231 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-04-18 16:55:34.598 INFO 5231 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-04-18 16:55:34.599 INFO 5231 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-04-18 16:55:34.599 INFO 5231 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-04-18 16:55:34.599 INFO 5231 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'logFilter' to urls: [*]
2018-04-18 16:55:34.599 INFO 5231 --- [ main] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-04-18 16:55:34.603 INFO 5231 --- [ main] o.e.jetty.server.handler.ContextHandler : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@42deb43a{/,[file:///private/var/folders/2_/7w9slqsn4jq70ggkq218lh1h98zj76/T/jetty-docbase.1975729984867654046.8090/],AVAILABLE}
2018-04-18 16:55:34.604 INFO 5231 --- [ main] org.eclipse.jetty.server.Server : Started @1843ms
2018-04-18 16:55:34.617 WARN 5231 --- [ main] ConfigServletWebServerApplicationContext : 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 of type 'com.mooc.house.mapper.UserMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2018-04-18 16:55:34.622 INFO 5231 --- [ main] org.eclipse.jetty.server.session : Stopped scavenging
2018-04-18 16:55:34.625 INFO 5231 --- [ main] o.e.jetty.server.handler.ContextHandler : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@42deb43a{/,[file:///private/var/folders/2_/7w9slqsn4jq70ggkq218lh1h98zj76/T/jetty-docbase.1975729984867654046.8090/],UNAVAILABLE}
2018-04-18 16:55:34.632 INFO 5231 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-04-18 16:55:34.708 ERROR 5231 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field userMapper in com.mooc.house.service.UserService required a bean of type 'com.mooc.house.mapper.UserMapper' that could not be found.
Action:
Consider defining a bean of type 'com.mooc.house.mapper.UserMapper' in your configuration.
2回答
-
慕虎8982419
2018-08-25
同学你好,这个问题你解决了嘛?我现在也遇到了
00 -
格鲁
2018-04-25
看看启动类是不是在root package
022018-08-25
相似问题
回答 1