java.lang.ClassNotFoundException: org.springframework.core.SpringProperties

调试时报错

Caused by: java.lang.NoClassDefFoundError: org/springframework/core/SpringProperties
at org.springframework.beans.CachedIntrospectionResults.<clinit>(CachedIntrospectionResults.java:98)
at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:327)
at org.springframework.beans.BeanWrapperImpl.getPropertyDescriptorInternal(BeanWrapperImpl.java:359)
at org.springframework.beans.BeanWrapperImpl.isWritableProperty(BeanWrapperImpl.java:438)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1458)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
... 38 more
Caused by: java.lang.ClassNotFoundException: org.springframework.core.SpringProperties
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 45 more

网上百度了好久,都没有找到解决方法,后来一一查看依赖,发现是引入了spring的其他包包含了spring-core,且版本为4.0.3.RELEASE,而我自己引入的spring-test版本为4.0.0.RELESASE,这个包里也包含了spring-core,从而导致spring-core包版本不一致产生了冲突,最后运行报错。


引入spring-test包的4.0.3.RELEASE版本,问题解决。



阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/manyangyangya/article/details/78458288
文章标签: spring junit 调试
个人分类: 问题解决
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭