在类路径 [activiti.cfg.xml] 中定义名称 'processName' 创建 bean 时出错 ...未找到默认构造函数
error creating bean with name 'processName' defined in classpath [activiti.cfg.xml] ...No default constructor found
我正在尝试 运行 对 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)
您的类路径中缺少依赖项。检查您是否有 mybatis 可用。
我正在尝试 运行 对 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)
您的类路径中缺少依赖项。检查您是否有 mybatis 可用。