classA里定义了一些属性,使用@service自动装配bean
classB使用A,使用@Autowired注入,运行后报错
严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@670002] to prepare test instance [com.xx.B@b97c004]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.xx.B': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.xx.A com.xx.B.a; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.didi.blackhorse.base.KopConstant] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.ann