创建名称为' processName'的bean时出错在classpath [activiti.cfg.xml]中定义...找不到默认构造函数

时间:2017-09-07 13:48:12

标签: java xml eclipse junit4 activiti

我正在尝试为activiti中的一个简单进程运行单元测试但是我一直在例外。我已经搜索并认为问题出在 activiti.cfg.xml 文件本身,它需要一个构造函数,但它有一个属性。测试是自动生成的,还有 activiti.cfg.xml 文件。所以我想知道应该改变什么才能让它发挥作用。

这是xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
        <property name="databaseSchemaUpdate" value="true"/>
    </bean>
</beans>

这就是错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineConfiguration' defined in class path resource [activiti.cfg.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/type/TypeHandler
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1228)

1 个答案:

答案 0 :(得分:0)

您在类路径中缺少依赖项。检查您是否有mybatis