org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.spring.demo.Test’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.spring.demo.BaseUtil’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
在被@Resource和@Autowired注入的类上加上@Component注解。