Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scanController': Unsatisfied dependency expressed through field 'cacheService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.zztl.cache.service.CacheService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
这个的原因是扫描不到对应的类,需要将启动来Application上的@ComponentScan("")注解中的包放开,包含上所有的你需要导入类的包名