In about 60% cases can not resolve JavaDelegate in Service after Timer

OK, then my assumption was wrong. Sorry for insisting.

Don’t worry about it. Thanks for your time and attention to help me.

1 Like

@romankh3 I was able to reproduce the issue. This issue will occur when you change the package name or moving the java delegates to another package after initiating the process instance.

Seems you have deployed your bpmn. At that moment lets say for example your java delegate DeleteDraftRequestDelegate is in the package called com.foo. And workflow was initiated in that moment, so in service task you configured as com.foo.DeleteDraftRequestDelegate. it will works fine. And the process instance is still active.

Now, you just moved the DeleteDraftRequestDelegate to new package called com.bar and also service task config looks like com.bar.DeleteDraftRequestDelegate. This configuration also will work fine only for newly launched process instances. But old process instances which are launched still referring to the delegates in this package com.foo. So thats why you are getting this class not found exception.

So you need to migrate your process to newer version of workflow deployemnt or else terminate the old running instances or ignore it.

Newly launched process instances will work fine. Old process instances will fail, new process instances will succeed the execution.

Hello @aravindhrs!
I got your point, but I don’t think that it’s related to my case, because of the reason that I redeploy every hour my instances and process instances are dropping before deploy.

@romankh3 if you move the class to other package, for those running instances it will give classnotfound exception. remaining everything looks fine in your process

Hi @romankh3,

if your Java class (or Spring bean) only exists in one of the two projects, make sure you configure the job executor to be deployment aware. Otherwise you might end up in a situation where the job executor of the application that does not have access to the class tries to execute the timer job and fails loading that class.

You can read more about this topic here:

https://docs.camunda.org/manual/7.10/user-guide/spring-boot-integration/configuration/#camunda-engine-properties

https://docs.camunda.org/manual/7.10/user-guide/process-engine/the-job-executor/#job-execution-in-heterogeneous-clusters

Cheers,
Ben

1 Like

Hi @benhoffmann!

if your Java class (or Spring bean) only exists in one of the two projects

It’s not my case, because of the reason, that I have two instances of the one application. So Am I right that this is not a Heterogeneous Cluster, it’s a homogeneous cluster?

I don’t know important it is or not, but I have Camunda-Cockpit app, where I’m checking processes.

Best regards,
Roman B.

How do you run Cockpit? If that is a separate application (e.g. a third Spring Boot app), this could be the cause. It could be that you have a setup running where Cockpit actually tries to fetch jobs, too.

I run Cockpit as a SpringBoot app, without any logic in an application. It’s app just for monitoring workflow processes.
Cockpit app has next dependencies:

        <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
        </dependency>

        <!-- Required to use Spin dataformat support -->
        <dependency>
            <groupId>org.camunda.spin</groupId>
            <artifactId>camunda-spin-dataformat-all</artifactId>
        </dependency>
        <dependency>
            <groupId>org.camunda.bpm</groupId>
            <artifactId>camunda-engine-plugin-spin</artifactId>
        </dependency>

        <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
        </dependency>

Can it be a trigger for this trouble?

Jep, that is most likely the one that causes your problems. You should disable the job executor for that application completely since you only use it for monitoring. Also, if you don’t need the REST API, you can remove that dependency.

3 Likes

Thanks, @benhoffmann!
You were right!

In total I want to write about it for other people:

I have a case, when I have Camunda-Cockpit Spring boot app, just for monitoring the business process.

And I have Spring-boot App with Camunda engine, where I have BPMN process.

It’s a heterogeneous cluster and JobExecutor, which triggers ProcessInstance after timer tries to find in Camunda-Cockpit app and Doesn’t find it at all. For this case, I get class not found exception

Thanks for all(@aravindhrs, @Niall, @Ingo_Richtsmeier, @benhoffmann), who helped me to understand the situation!

The solution was to disable JobExecutor at all by providing property in application.properties. Camunda has property for this case.

I hope it will help other people. If someone has a question, don’t hesitate to ask me on this topic or private message.

4 Likes

Hi romankh3,

Even i’m facing the same issue.Have tried disabling the job executor, but still the issue persists :frowning:

Hi @srikanth1, your issue might be cause by synchronous calls to the engine, which are not related to the job executor but executed by the client thread. Have a look at: https://docs.camunda.org/manual/7.11/user-guide/process-engine/transactions-in-processes/

Cheers,
Ben