{"id":703,"date":"2019-11-12T19:46:10","date_gmt":"2019-11-12T11:46:10","guid":{"rendered":"http:\/\/prayerlaputa.com\/?p=703"},"modified":"2019-11-12T19:46:10","modified_gmt":"2019-11-12T11:46:10","slug":"spring-boot-%e5%a4%9a%e4%b8%aa%e5%8c%85%e5%90%af%e5%8a%a8%e5%a4%b1%e8%b4%a5-%e6%b7%bb%e5%8a%a0%e6%b3%a8%e8%a7%a3%e6%89%ab%e6%8f%8f%e5%a4%9a%e4%b8%aa%e5%8c%85","status":"publish","type":"post","link":"http:\/\/prayerlaputa.com\/?p=703","title":{"rendered":"spring boot \u591a\u4e2a\u5305\u542f\u52a8\u5931\u8d25-\u6dfb\u52a0\u6ce8\u89e3\u626b\u63cf\u591a\u4e2a\u5305"},"content":{"rendered":"<h1>spring boot \u591a\u4e2a\u5305\u542f\u52a8\u5931\u8d25-\u89e3\u51b3\uff1a\u626b\u63cf\u591a\u4e2a\u5305<\/h1>\n<div class=\"mume markdown-preview \">\n<p>\u8868\u73b0\uff1a\u542f\u52a8\u65f6\u63d0\u793a\u5982\u4e0b\u4fe1\u606f\uff1a<br \/>\n\u56e0\u4e3a\u9879\u76ee\u9700\u8981\uff0c\u5c06\u4ee3\u7801\u7ed3\u6784\u8c03\u6574\u4e3a\uff1a<\/p>\n<ul>\n<li><a href=\"http:\/\/com.xxx\">com.xxx<\/a>\n<ul>\n<li>xx<\/li>\n<li>yy<\/li>\n<li>XxxxApplication<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><!--more--><br \/>\n\u8fd9\u79cd\u7ec4\u7ec7\u7ed3\u6784\uff0c\u6ce8\u610f\uff0c\u6b64\u5904\u65f6\u540c\u4e00\u4e2a\u9879\u76ee\uff08\u6ca1\u6709\u62c6\u5206\u6210\u591a\u4e2amaven\u6a21\u5757\uff09\uff0c\u6709\u591a\u4e2a\u5305\u4fdd\u5b58\u4e0d\u540c\u529f\u80fd\u6a21\u5757\u7684\u4ee3\u7801\u3002\u6b64\u65f6\u542f\u52a8\u9879\u76ee\uff0c\u62a5\u9519\u5982\u4e0b\uff1a<\/p>\n<pre class=\"language-\" data-role=\"codeBlock\" data-info=\"\"><code>Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.\r\n2019-11-12 19:28:40.563 [recruit_system] [main] ERROR [org.springframework.boot.SpringApplication] -Application startup failed\r\norg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeForPcController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'enrollInfoServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.xxx.yy.mapper.EnrollInfoMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\r\n\tat org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:321)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)\r\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)\r\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)\r\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)\r\n\tat org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)\r\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)\r\n\tat org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:303)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)\r\n\tat com.xxx.RecruitApplication.main(RecruitApplication.java:27)\r\nCaused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'enrollInfoServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.xxx.yy.mapper.EnrollInfoMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)\r\n\tat org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)\r\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)\r\n\tat org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)\r\n\tat org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:518)\r\n\tat org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:496)\r\n\tat org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:627)\r\n\tat org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169)\r\n\tat org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)\r\n\tat org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:318)\r\n\t... 17 common frames omitted\r\nCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.xxx.yy.mapper.EnrollInfoMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1493)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1104)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)\r\n\t... 35 common frames omitted\r\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u521d\u59cb\u5316\u5404\u79cdbean\u5931\u8d25\uff08controller\u3001service\u7b49\uff09\u3002<\/p>\n<h2 id=\"%E8%A7%A3%E5%86%B3\" class=\"mume-header\">\u89e3\u51b3<\/h2>\n<p>\u63a8\u6d4b\u662fspring boot\u542f\u52a8\u7c7b\u626b\u63cf\u4ee3\u7801\u7684\u76ee\u5f55\u9519\u8bef\u3002\u5728\u542f\u52a8\u7c7b\u7684<code>@SpringBootApplication<\/code>\u6ce8\u89e3\u4e2d\u6307\u5b9a\uff1a<\/p>\n<pre class=\"language-\" data-role=\"codeBlock\" data-info=\"\"><code>@SpringBootApplication(scanBasePackages = {\"com.xxx.xx\", \"com.xxx.yy\"})\r\n<\/code><\/pre>\n<p>\u5373\u53ef\u89e3\u51b3\u8be5\u95ee\u9898\u3002<\/p>\n<p>\u4f46\u6709\u5f15\u5165\u65b0\u95ee\u9898\uff1a<\/p>\n<h1 id=\"%E6%96%B0%E5%A2%9Emapper%E5%90%8Emapper%E5%AE%9E%E4%BE%8B%E5%8C%96%E5%A4%B1%E8%B4%A5\" class=\"mume-header\">\u65b0\u589emapper\u540e\uff0cmapper\u5b9e\u4f8b\u5316\u5931\u8d25<\/h1>\n<p>\u62a5\u51fa\u5982\u4e0b\u5f02\u5e38\uff1a<\/p>\n<pre class=\"language-\" data-role=\"codeBlock\" data-info=\"\"><code>Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.\r\n2019-11-12 19:33:32.772 [recruit_system] [main] ERROR [org.springframework.boot.SpringApplication] -Application startup failed\r\norg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeForPcController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'enrollInfoServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.xxx.yy.mapper.EnrollInfoMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\r\n\tat org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:321)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)\r\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)\r\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)\r\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)\r\n\tat org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)\r\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)\r\n\tat org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:303)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)\r\n\tat com.xxx.RecruitApplication.main(RecruitApplication.java:26)\r\nCaused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'enrollInfoServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.xxx.yy.mapper.EnrollInfoMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)\r\n\tat org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)\r\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)\r\n\tat org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)\r\n\tat org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:518)\r\n\tat org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:496)\r\n\tat org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:627)\r\n\tat org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169)\r\n\tat org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)\r\n\tat org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:318)\r\n\t... 17 common frames omitted\r\nCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.xxx.yy.mapper.EnrollInfoMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1493)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1104)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)\r\n\t... 35 common frames omitted\r\n<\/code><\/pre>\n<h2 id=\"%E8%A7%A3%E5%86%B3-1\" class=\"mume-header\">\u89e3\u51b3<\/h2>\n<p>\u6dfb\u52a0\u626b\u63cf\u591a\u4e2a\u5305\u6ce8\u89e3\uff1a<br \/>\n\u5728\u542f\u52a8\u7c7b\u4e2d\u6dfb\u52a0<code>@MapperScan<\/code>\uff0c\u5e76\u5199\u4e0a\u4e0d\u540c\u5305\u7684mapper\uff1a<\/p>\n<pre class=\"language-\" data-role=\"codeBlock\" data-info=\"\"><code>@MapperScan({\"com.xxx.yy.mapper\", \"com.xxx.xx.mapper\"})\r\n@SpringBootApplication(scanBasePackages = {\"com.xxx.recruit\", \"com.xxx.employee\"})\r\n@ServletComponentScan\r\n@EnableScheduling\r\n@Slf4j\r\npublic class RecruitApplication \u2026\u2026\r\n\u2026\u2026\r\n<\/code><\/pre>\n<h1 id=\"%E5%8F%82%E8%80%83%E6%96%87%E7%AB%A0\" class=\"mume-header\">\u53c2\u8003\u6587\u7ae0<\/h1>\n<ul>\n<li><a href=\"https:\/\/www.cnblogs.com\/zipon\/p\/9545590.html\">spring-boot\u9879\u76eeMapperScan\u6ce8\u89e3\u5305\u542b\u591a\u4e2a\u5305<\/a><\/li>\n<\/ul>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>spring boot \u591a\u4e2a\u5305\u542f\u52a8\u5931\u8d25-\u89e3\u51b3\uff1a\u626b\u63cf\u591a\u4e2a\u5305 \u8868\u73b0\uff1a\u542f\u52a8\u65f6\u63d0\u793a\u5982\u4e0b\u4fe1\u606f\uff1a \u56e0\u4e3a\u9879\u76ee\u9700\u8981\uff0c\u5c06\u4ee3\u7801\u7ed3\u6784 <a href='http:\/\/prayerlaputa.com\/?p=703' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[6,74,75],"tags":[37,76],"_links":{"self":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/703"}],"collection":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=703"}],"version-history":[{"count":1,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/703\/revisions"}],"predecessor-version":[{"id":704,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/703\/revisions\/704"}],"wp:attachment":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=703"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}