I have written a small code to check @Autowired annotation in Spring, here is my piece of code.

package beans;

        //import org.springframework.beans.factory.annotation.AutoWired;
        import org.springframework.beans.factory.annotation.Autowired;
        //import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
        import org.springframework.beans.factory.annotation.Qualifier;
        //import org.springframework.beans.factory.annotation.*;

        public class Car {

            @Autowired
            @Qualifier(value="e1")
            private Engine engine;

            //no need to have setters or constructors here
            public void printData()
            {

                System.out.println("Engine model year: " +engine.getModelyear());

            }

        }



        package beans;

        public class Engine {
            private String modelyear;
            //generate setter and getter

            public void setModelyear(String modelyear) {
                this.modelyear = modelyear;
            }

            public String getModelyear() {
                return modelyear;
            }

        }

    package test;

    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;
    import beans.Car;
    //import beans.Test;
    public class Client {

        /**
         * @param args
         */
        public static void main(String[] args) {
        ApplicationContext ap = new ClassPathXmlApplicationContext("resource/spring.xml");
        Car c=(Car)ap.getBean("c");
        c.printData();

        }

    }

<!--spring.xml-->
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">

<beans>
<!-- activate autowire annotation -->
    <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
        <bean id="engine" class="beans.Engine">
            <property name="modelyear" value="2015"/>
        </bean> 
        <bean id="e1" class="beans.Engine">
            <property name="modelyear" value="2016"/>
        </bean>

        <bean id="c" class="beans.Car">
        </bean>
</beans>

When I am trying to run Client.java class ,I am getting following error: Can someone suggest why I am facing this issue?

2017年3月11日上午10:19:24 org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO:刷新org.springframework.context.support.ClassPathXmlApplicationContext@70d18a80:显示名称[org.springframework.context.support.ClassPathXmlApplicationContext@70d18a80] ;启动日期[2017年3月11日星期六10:19:24 IST 2017];上下文层次结构3月11日,2017 10:19:24 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO:从类路径资源加载XML bean定义[resource / spring.xml] 2017年3月11日10:19 :25 am org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory INFO:应用程序上下文的Bean工厂[org.springframework.context.support.ClassPathXmlApplicationContext@70d18a80]:org.springframework.beans.factory.support.DefaultListableBeanFactory@18d1cf9e 3月11日, 2017 10:19:25 AM org.springframework.context.support.AbstractApplicationContext $ BeanPostProcessorChecker postProcessAfterInitialization INFO:Bean'org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor'不适合所有BeanPostProcessors处理(例如:不符合条件) for auto-proxying)2017年3月11日上午10:19:25 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons信息:在org.springframework.beans.factory.support.DefaultListableBeanFactory@18d1cf9e中预先实例化单例:定义bean [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor,engine,e1,c];工厂层级的根据2017年3月11日上午10:19:25 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons信息:在org.springframework.beans.factory.support.DefaultListableBeanFactory@18d1cf9e中销毁单例:定义bean [org . springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor,发动机,E1,C];工厂层次结构的根在线程“main”中的异常org.springframework.beans.factory.BeanCreationException:创建名为“c”的bean时出错:字段自动装配失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private beans.Engine beans.Car.engine;嵌套异常是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 /郎/对象;引起:org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private beans.Engine beans.Car.engine;嵌套异常是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 /郎/对象;引起: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 /郎/对象; at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor $ AutowiredElement.inject(AutowiredAnnotationBeanPostProcessor.java:361)org.springframework.beject.InjectMetadata.injectFields(InjectionMetadata.java:61)at org.springframework.beans位于org.springframework.beans.factory.support.AbstractBeanFactory $ 1的org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:414)的.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:228) . 位于org.springframework.beans.factory.suton(DefaultSingletonBeanRegistry.java:155)的org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)中的getObject(AbstractBeanFactory.java:249)在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)a在org.springframework.context.support.ClassPathXmlApplicationContext的org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)中的org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291) . (ClassPathXmlApplicationContext.java:122)atg.springframework.context.support.ClassPathXmlApplicationContext . (ClassPathXmlApplicationContext.java:66)at test.Client.main(Client.java:13)

我正在使用的 jar 是:

List of jars used and reference libraries while creating the project