1、报错内容

  1. 2020-08-10 10:11:15.818 ERROR 15704 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
  2. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'doCustomerFieldService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerFieldSetServiceImpl': Unsatisfied dependency expressed through field 'customerFieldSetMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerFieldSetMapper' defined in file [D:\LinkSpace\Work\WorkSpace\Code\IDEA\wm-web\target\classes\com\wm\dao\CustomerFieldSetMapper.class]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mapperHelper' of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property 'mapperHelper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
  3. at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:321)
  4. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
  5. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
  6. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
  7. at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
  8. at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
  9. at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
  10. at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
  11. at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
  12. at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
  13. at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
  14. at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
  15. at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
  16. at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
  17. at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
  18. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
  19. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
  20. at com.wm.Application.main(Application.java:19)
  21. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  22. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  23. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  24. at java.lang.reflect.Method.invoke(Method.java:498)
  25. at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
  26. Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerFieldSetServiceImpl': Unsatisfied dependency expressed through field 'customerFieldSetMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerFieldSetMapper' defined in file [D:\LinkSpace\Work\WorkSpace\Code\IDEA\wm-web\target\classes\com\wm\dao\CustomerFieldSetMapper.class]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mapperHelper' of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property 'mapperHelper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
  27. at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
  28. at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
  29. at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
  30. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
  31. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
  32. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
  33. at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
  34. at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
  35. at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
  36. at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
  37. at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
  38. at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
  39. at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
  40. at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:518)
  41. at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:496)
  42. at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:627)
  43. at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169)
  44. at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
  45. at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:318)
  46. ... 22 common frames omitted
  47. Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerFieldSetMapper' defined in file [D:\LinkSpace\Work\WorkSpace\Code\IDEA\wm-web\target\classes\com\wm\dao\CustomerFieldSetMapper.class]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mapperHelper' of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property 'mapperHelper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
  48. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1568)
  49. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1276)
  50. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
  51. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
  52. at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
  53. at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
  54. at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
  55. at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
  56. at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
  57. at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
  58. at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
  59. at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
  60. ... 40 common frames omitted
  61. Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'mapperHelper' of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property 'mapperHelper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
  62. at org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:243)
  63. at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:437)
  64. at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:292)
  65. at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:280)
  66. at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
  67. at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
  68. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1564)
  69. ... 51 common frames omitted

2、问题分析及解决办法

SpringBoot的热部署插件devtools不支持通用型Mapper,注释掉(或者不引用)相关依赖即可
reimport pom(重新导入依赖),再次运行即可