使用@Autowired注解的时候抛异常:(注解在属性和setter方法上都是抛异常的)
Exception in thread "main"
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'boss': Autowiring of fields failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire field: private testSpringAnnotation.Car
testSpringAnnotation.Boss.car; nested exception is
java.lang.NoSuchMethodError:
org.springframework.beans.factory.config.ConfigurableListableBeanFactory.resolveDependency(Lorg/springframework/beans/factory/config/DependencyDescriptor;Ljava/lang/String;Ljava/util/Set;Lorg/springframework/beans/TypeConverter;)Ljava/lang/Object;
spring配置:
public class Boss {
@Autowired
private Car car;
@Autowired
private Office office;
...
}
恳求大侠指点