cancel
Showing results for 
Search instead for 
Did you mean: 

Fail to load custom parse listener

tony_dietrich
Champ in-the-making
Champ in-the-making
During configuration of the Activiti engine I am attempting to load a custom parser.

The load fails with the following message:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineConfiguration' defined in resource loaded through InputStream: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.util.List' for property 'customPostBPMNParseListeners'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.kallik.wm.listeners.WorkflowManagerCustomParseListener] to required type [org.activiti.engine.impl.bpmn.parser.BpmnParseListener] for property 'customPostBPMNParseListeners[0]': no matching editors or conversion strategy found

The activiti.config.xml used is:

<?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.StandaloneProcessEngineConfiguration"> 
    <!– Database configurations –>
    <property name="databaseSchemaUpdate" value="true" />
    <property name="databaseType" value="oracle" />
    <property name="jdbcUrl" value="jdbc:oracle:thin:@*********" />
    <property name="jdbcDriver" value="oracle.jdbc.driver.OracleDriver" />
    <property name="jdbcUsername" value="*****" />
    <property name="jdbcPassword" value="*******" />
   <property name="jobExecutorActivate" value="true" />
   <property name="history" value="full" />
   <!– Required to create a task listener that is executed on every task creation, completion, transition etc. –>
   <property name="customPostBPMNParseListeners">
      <list>
         <bean class="com.kallik.wm.listeners.WorkflowManagerCustomParseListener" />
      </list>
   </property>
  </bean>
</beans>

Although I don't think its getting this far, the class referred to is defined as follows:

public class WorkflowManagerCustomParseListener implements BpmnParseListener {
    private static final Logger log = Logger.getLogger(WorkflowManagerCustomParseListener.class);

    /**
     * {@inheritDoc}
     * <P>
     * Adds generic listeners for create, assignment and complete operations for all user tasks in the system.
     */
    public void parseUserTask(Element userTaskElement, ScopeImpl scope, ActivityImpl activity) {
        log.info("Adding listeners to all of the user tasks for workflow: " + scope.getProcessDefinition().getName());
        UserTaskActivityBehavior utab = (UserTaskActivityBehavior) activity.getActivityBehavior();
        log.info("Adding CandidateGroupRenamerListener listener to all of the user tasks for workflow: "
                + scope.getProcessDefinition().getName());
        utab.getTaskDefinition().addTaskListener("create", new CandidateGroupRenamerListener());
        log.info("Adding GenericUserTaskCreateListener listener to all of the user tasks for workflow: "
                + scope.getProcessDefinition().getName());
        utab.getTaskDefinition().addTaskListener("create", new GenericUserTaskCreateListener());
        log.info("Adding GenericUserTaskCompletedListener listener to all of the user tasks for workflow: "
                + scope.getProcessDefinition().getName());
        utab.getTaskDefinition().addTaskListener("complete", new GenericUserTaskCompletedListener());
    }


… no further concrete method implementations …

}

Can anyone give me any ideas to help solve this, please?
5 REPLIES 5

trademak
Star Contributor
Star Contributor
Hi Tony,

Are you using an old Activiti version? We are using postBpmnParseHandlers for quite some time now.

Best regards,

tony_dietrich
Champ in-the-making
Champ in-the-making
We're using activiti5.11, and are locked into this version because of issues out of our control

trademak
Star Contributor
Star Contributor
Ok, understood.
This is the exception message that's important:

cannot convert value of type [com.kallik.wm.listeners.WorkflowManagerCustomParseListener] to required type [org.activiti.engine.impl.bpmn.parser.BpmnParseListener]

Did you implement the correct BpmnParseListener interface?
Which version of Spring are you using?
Could you create a unit test project showing the issue?

Thanks,

tony_dietrich
Champ in-the-making
Champ in-the-making
Hi Tijs

I'm not too sure what you mean.

As you can see from the definition of the WorkflowManagereParseListener in my first post, the class is:

<code>
public class WorkflowManagerCustomParseListener implements BpmnParseListener {

}
</code>
In this case BpmnParseListener resolves to org.activiti.engine.impl.bpmn.parser.BpmnParseListener. 

jbarrez
Star Contributor
Star Contributor
I don't see anything wrong there … seems to be a Spring wiring issue. What version of Spring is on your classpath?