简体   繁体   中英

Error start process instance of Camunda: ENGINE-09008 Exception while instantiating class

I'm trying to listen a task of camunda process, using spring boot. I write this class:

import org.camunda.bpm.engine.delegate.DelegateTask;
import org.camunda.bpm.engine.delegate.TaskListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Mytask implements TaskListener {

    private Logger logger = LoggerFactory.getLogger(Mytask.class);

    @Override
    public void notify(DelegateTask delegateTask) {
        logger.debug("This is Mytask listener");
    }

}

I deploy a camunda process with a user task:

在此处输入图像描述

In this task, I defined a task listeners:

在此处输入图像描述

When I start a process instance, I've got this error:

I've got following error: Cannot submit task form 53768af3-9c8e-11ed-a686-540126414107: ENGINE-03051 There was an exception while invoking the TaskListener. Message: 'ENGINE-09008 Exception while instantiating class 'xxx.camunda.Mytask': ENGINE-09017 Cannot load class 'xxx.camunda.Mytask': xxx.camunda.Mytask'.

The class you specified in the model cannot be found in the classloader.

  • make sure the fully qualified class name is spelled correctly in the model.
  • make sure the new model has been deployed successfully and you are starting a new process instances, based on this version (do not test with an old instance based on an old model)
  • make sure the class you are referencing compiles
  • make sure the class has been placed correctly in a src folder of your IDE and indeed ends up in the class path of the runtime
  • try a mvn clean package or equivalent via your IDE

Here is an example, also illustrating a few more things: https://github.com/rob2universe/flexible-delegate/blob/main/src/main/java/com/camunda/example/service/LoggerDelegate.java

https://github.com/rob2universe/flexible-delegate/blob/main/src/main/resources/process.bpmn

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM