java.lang.NoClassDefFoundError: org/springframework/core/io/Resource

标签: junit spring Activiti
12141人阅读 评论(0) 收藏 举报
分类:

1、错误描述

java.lang.NoClassDefFoundError: org/springframework/core/io/Resource
	at org.activiti.engine.ProcessEngineConfiguration.createProcessEngineConfigurationFromResource(ProcessEngineConfiguration.java:232)
	at org.activiti.engine.ProcessEngineConfiguration.createProcessEngineConfigurationFromResource(ProcessEngineConfiguration.java:228)
	at org.activiti.engine.impl.test.TestHelper.getProcessEngine(TestHelper.java:227)
	at org.activiti.engine.test.ActivitiRule.initializeProcessEngine(ActivitiRule.java:237)
	at org.activiti.engine.test.ActivitiRule.starting(ActivitiRule.java:205)
	at org.activiti.engine.test.ActivitiRule.startingQuietly(ActivitiRule.java:171)
	at org.activiti.engine.test.ActivitiRule.access$000(ActivitiRule.java:86)
	at org.activiti.engine.test.ActivitiRule$1.evaluate(ActivitiRule.java:124)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.Resource
	at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 24 more

java.lang.NullPointerException
	at org.activiti.designer.test.ProcessTestAudition.startProcess(ProcessTestAudition.java:26)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.activiti.engine.test.ActivitiRule$1.evaluate(ActivitiRule.java:126)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

java.lang.NullPointerException
	at org.activiti.engine.test.ActivitiRule.finished(ActivitiRule.java:273)
	at org.activiti.engine.test.ActivitiRule.finishedQuietly(ActivitiRule.java:179)
	at org.activiti.engine.test.ActivitiRule.access$400(ActivitiRule.java:86)
	at org.activiti.engine.test.ActivitiRule$1.evaluate(ActivitiRule.java:135)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


2、错误原因

     由错误提示可知,是缺少spring核心包


3、解决办法

     在pom.xml中加入:

<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.3.0.RELEASE</version>
</dependency>



查看评论

编程高手箴言》读后 #2

毕业也有几年了,也看了和学了不少东西。有时也想写点什么,但总是觉得头绪很多,一直没有动笔。最近翻了翻梁先生的《编程高手箴言》,突然想写点什么,权且用读书笔记的形式写点东西。等号上面的摘字《箴言》,下面...
  • seacloud
  • seacloud
  • 2003-12-28 12:27:00
  • 1385

关于maven出现java.lang.NoSuchMethodError: org.springframework.core.io.ResourceEditor

这个问题多半是出现jar包冲突 可能是重复引入相同的jar包引入其他jar包时,内部依赖(包含了)相同的jar包 解决方案:找到pom.xml文件,调至dependency hierarchy...
  • sinat_37464123
  • sinat_37464123
  • 2017-05-23 13:16:35
  • 1034

Spring中java.lang.NoClassDefFoundError: org/springframework/core/MethodIntrospector

使用Spring时出现如下异常:java.lang.NoClassDefFoundError: org/springframework/core/MethodIntrospector原因是spring...
  • wang704987562
  • wang704987562
  • 2017-01-14 14:16:22
  • 1622

JavaWeb:java.lang.NoClassDefFoundError:org/springframework/core/OrderComparator

JavaWeb:java.lang.NoClassDefFoundError: org/springframework/core/OrderComparator$OrderSourceProvider...
  • yitian881112
  • yitian881112
  • 2018-01-08 09:31:51
  • 235

java.lang.NoClassDefFoundError: org/springframework/dao/support/DaoSupport

缺少:org.springframework.transaction-3.0.5.RELEASE.jar
  • Truong
  • Truong
  • 2013-12-15 20:55:43
  • 25682

java.lang.NoSuchMethodError: org.springframework.core.io.ResourceEditor错误

一般是jar包冲突,或者某些jar包版本不同。 如上,spring其他包的版本均为4.2.5,而spring-webmvc的jar包为1.2.6版本,造成版本冲突。 ...
  • danchaofan0534
  • danchaofan0534
  • 2016-04-22 14:38:59
  • 5848

junit4+spring单元测试java.lang.NoClassDefFoundError:org/springframework/core/SpringProperties

报这个错 java.lang.NoClassDefFoundError:org/springframework/core/SpringProperties 搞了老半天,原来是pom里面的版本不一致 ...
  • crystal_tyan
  • crystal_tyan
  • 2014-11-30 16:09:02
  • 4618

org.springframework.core.io.Resource接口源码分析

该接口继承了InputStreamSource接口 boolean exists(); 返回该资源是否存在 boolean isReadable(); 返回该资源是否是可读资源 bo...
  • show_me_the_world
  • show_me_the_world
  • 2015-10-18 00:29:47
  • 2254

Spring10种常见异常解决方法

在程序员生涯当中,提到最多的应该就是SSH三大框架了。作为第一大框架的Spring框架,我们经常使用。 然而在使用过程中,遇到过很多的常见异常,我在这里总结一下,大家共勉。 一、找不到配置文件的异...
  • evo_steven
  • evo_steven
  • 2015-02-28 14:54:41
  • 97550

SpringBoot项目创建报:java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication错误的解决方案

第一次创建SpringBoot项目结果出现了不少错误,其他错误都通过百度的方式得到解决,唯独这个错误困扰我很久了,而且百度上没有对于这种错误的解决方案。 所以给出这种错误的解决方案: 虽然明显知道...
  • zwb19940216
  • zwb19940216
  • 2017-10-07 23:17:34
  • 2788
    个人资料
    专栏达人 持之以恒
    等级:
    访问量: 603万+
    积分: 7万+
    排名: 25
    新浪博客
    博客专栏
    FusionCharts

    文章:14篇

    阅读:72258
    Flex

    文章:13篇

    阅读:29777
    dojo

    文章:10篇

    阅读:31029
    Linux

    文章:47篇

    阅读:68938
    最新评论