Search code examples
javaxmleclipsejunit4activiti

error creating bean with name 'processName' defined in classpath [activiti.cfg.xml] ...No default constructor found


I am trying to run a unit test for a simple process in activiti but I keep getting an exception. I've searched and believe the problem is in the activiti.cfg.xml file itself, it expects a constructor but it has a property instead. The test was auto generated and the activiti.cfg.xml file as well. So I want to know what should I change to make it work.

This is the xml file:

<?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>

And this is the error:

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)

Solution

  • You are missing a dependency in your classpath. Check that you have mybatis available.