Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/expression/PropertyAc

完整的错误信息

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/expression/PropertyAccessor
    at org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:630)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:517)
    at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
    at cn.atgnnu.spring.beans.Main.main(Main.java:13)===》这一行获取IOC容器报错了
Caused by: java.lang.ClassNotFoundException: org.springframework.expression.PropertyAccessor
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 5 more

 

原因很简单少了spring-expression-4.3.25.RELEASE.jar包,找到spring-framwork的lib包下找到添加到类库中即可Exception in thread

你可能感兴趣的:(spring)