技术标签: spring junit JUnit Activiti Spring Mybatis
1、错误描述
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineConfiguration' defined in class path resource [activiti.cfg.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/session/SqlSessionFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.activiti.engine.impl.cfg.BeansConfigurationHelper.parseProcessEngineConfiguration(BeansConfigurationHelper.java:36)
at org.activiti.engine.impl.cfg.BeansConfigurationHelper.parseProcessEngineConfigurationFromResource(BeansConfigurationHelper.java:48)
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:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
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.NoClassDefFoundError: org/apache/ibatis/session/SqlSessionFactory
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2688)
at java.lang.Class.privateGetPublicMethods(Class.java:2814)
at java.lang.Class.privateGetPublicMethods(Class.java:2830)
at java.lang.Class.privateGetPublicMethods(Class.java:2830)
at java.lang.Class.getMethods(Class.java:1602)
at org.springframework.beans.ExtendedBeanInfoFactory.supports(ExtendedBeanInfoFactory.java:54)
at org.springframework.beans.ExtendedBeanInfoFactory.getBeanInfo(ExtendedBeanInfoFactory.java:46)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:270)
at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:189)
at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:172)
at org.springframework.beans.BeanWrapperImpl.getLocalPropertyHandler(BeanWrapperImpl.java:225)
at org.springframework.beans.BeanWrapperImpl.getLocalPropertyHandler(BeanWrapperImpl.java:63)
at org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyHandler(AbstractNestablePropertyAccessor.java:725)
at org.springframework.beans.AbstractNestablePropertyAccessor.isWritableProperty(AbstractNestablePropertyAccessor.java:557)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1483)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
... 31 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:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
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:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
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)
org.activiti.engine.ActivitiException: Programmatic error: could not instantiate org.activiti.designer.test.ProcessTestAudition
at org.activiti.engine.test.ActivitiRule.finished(ActivitiRule.java:268)
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:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
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/activiti/designer/test/ProcessTestAudition
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:259)
at org.activiti.engine.test.ActivitiRule.finished(ActivitiRule.java:265)
... 19 more
由错误提示可知,缺少ibatis有关的jar包
package org.apache.ibatis.session;
import java.sql.Connection;
public abstract interface SqlSessionFactory
{
public abstract SqlSession openSession();
public abstract SqlSession openSession(boolean paramBoolean);
public abstract SqlSession openSession(Connection paramConnection);
public abstract SqlSession openSession(TransactionIsolationLevel paramTransactionIsolationLevel);
public abstract SqlSession openSession(ExecutorType paramExecutorType);
public abstract SqlSession openSession(ExecutorType paramExecutorType, boolean paramBoolean);
public abstract SqlSession openSession(ExecutorType paramExecutorType, TransactionIsolationLevel paramTransactionIsolationLevel);
public abstract SqlSession openSession(ExecutorType paramExecutorType, Connection paramConnection);
public abstract Configuration getConfiguration();
}
/* Location: C:\Users\Administrator\Desktop\ibatis-core-3.0.jar
* Qualified Name: org.apache.ibatis.session.SqlSessionFactory
* Java Class Version: 5 (49.0)
* JD-Core Version: 0.7.0.1
*/
3、解决办法
(1)将ibatis-core-3.0.jar复制到lib目录下
(2)在pom.xml中添加
<!-- https://mvnrepository.com/artifact/org.apache.ibatis/ibatis-core -->
<dependency>
<groupId>org.apache.ibatis</groupId>
<artifactId>ibatis-core</artifactId>
<version>3.0</version>
</dependency>
表征模块的开始与结束。:模块名可由用户指定,可包含字母、数字及下划线,需以字母开头,区分大小写:赋值操作关键字,该关键字后可跟一个赋值表达式,该关键字是实现组合逻辑操作的一种主要描述方式。:表征该信号的方向,除输入、输出外还有一种inout(输入输出)型。
Paho MQTT C客户端是一个使用标准C编写的流畅的MQTT。 实际上包含了两个C API,同步的和异步的,分别为MQTTClient和MQTTAsync。同步的API可以更简单更使用,执行完操作后,一些调用会被阻拦,编程也更容易;而在异步API没有调用的阻拦操作,所有API的调用都是通过会调来实现的,这使得API更适合有窗口环境的操作系统,许多应用没有主线程控制。linux环境: 在lin
实验4 用双线性变换法设计 IIR 滤波器实验目的熟悉模拟Batterworth滤波器设计和用双线性变换法设计IIR数字滤波器的方法。实验原理利用双线性变换设计IIR滤波器,首先要设计出满足指标要求的模拟滤波器的传递函数,然后由通过双线性变换可得所要设计的IIR滤波器的系统函数。如果给定的指标为数字滤波器的指标,则首先要转换成模拟域指标。低通数字滤波器设计数...
#md#引导语本小节我们来介绍本章最后一个队列:ArrayBlockingQueue。按照字面翻译,中文叫做数组阻塞队列,从名称上看,我们就比较清楚此阻塞队列底层使用的是数组。一说到数组,大家可能会想到 ArrayList 和 HashMap,举新增场景来说 ArrayList 通过 size ++ 找到新增的数组下标位置,HashMap 通过 hash 算法计算出下标位置,那么 ArrayBlockingQueue 是不是也是这两种方法呢?都不是,ArrayBlockingQueue 使用的是一种非常
DIY本文基于HTML5 Video API,自定义Web视频播放器样式。其实吧,原生的video 标签样式挺好看的,但每个人的视觉感受不一样,所以就会有需要改变原生样式的时候。那就给它化个妆咯。淡妆,淡妆。【code here】<video class="ppq-video video-hidden" src="http...
地址:https://blog.csdn.net/massivestars/article/details/53911620/在做目录树的时候通常是将一个目录存在数据库的List全部返回来,再根据节点id和parentId组装成一颗树。这里切忌使用递归查询数据库的方式实现,应把对应的目录数据全部查询回来再进行组装。List转成Tree有两种方式,一种是常用的递归,一种是双层循环。pack...
一、三种BOOT模式介绍所谓启动,一般来说就是指我们下好程序后,重启芯片时,SYSCLK的第4个上升沿,BOOT引脚的值将被锁存。用户可以通过设置BOOT1和BOOT0引脚的状态,来选择在复位后的启动模式。BOOT模式配置以及作用" style="margin:0px; padding:0px; border:0px; font-style:inherit; font-variant:in
【原创 Hadoop&Spark 动手实践 10】Spark SQL 程序设计基础与动手实践(下)目标:1. 深入理解Spark SQL 程序设计的原理2. 通过简单的命令来验证Spark SQL的运行原理3. 通过一个完整的案例来验证Spark SQL的运行原理,自己实际动手来进行掌握4. 顺利完成“篮球运动员评估系统”...
1.K-Means聚类(划分聚类)算法步骤: (1) 首先我们选择一些类/组,并随机初始化它们各自的中心点。中心点是与每个数据点向量长度相同的位置。这需要我们提前预 知类的数量(即中心点的数量)。 (2) 计算每个数据点到中心点的距离,数据点距离哪个中心点最近就划分到哪一类中。 (3) 计算每一类中中心点作为新的中心点。 (4) 重复以上步骤,直到每一类...
前言提取像素矩阵中的一个圆环一、方法(1)读取一帧照片(2)确定一个圆在像素矩阵中的坐标,同理多个圆(3)根据坐标提取圆环在像素矩阵中对应的像素值二、使用步骤1.MATLAB实现代码如下(示例):clc;clear;frameImg = imread('03.bmp');[m ,n ,k]=size(frameImg);figure(1);imshow(frameImg);%像素矩阵中心坐标ox=n/2;oy=m/2;%采样点个数721th=0:0.5:360;xr
最开始遇到这个错误,首先检查参数 setPreviewSize,需要设置设备支持的预览尺寸 val params = camera.parameters for(size in params.supportedPictureSizes){ if(size.width == previewSize.width){ ...