Boundary timer event not able to load java class or recognize property


#1

Hi Team,

I’ve created a spring boot app and embedded my process engine.

timertest

I’m trying to invoke a Java Delegate when my user doesn’t act on his UserTask for a particular time. For this, i’m using a Boundary Timer Event on the User Task. When the event gets fired, it is throwing an error that class is not found. Could you please help on this?


#2

can you upload your bpmn file and JavaDelegate?


#3

Sure @aravindhrs ! Here’s my bpmn file :

timertest.bpmn (3.4 KB)

and my delegate code:

package com.process.listener;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class ReminderTaskDelegate implements JavaDelegate {
@Override
public void execute(DelegateExecution arg0) throws Exception {
log.info(“Notifying to user…”);

}

}


#4

@srikanth1, are you able to see this log log.info(“Notifying to user…”); for atleast one time?
Because you configured the timer boundary event as cyclic process. So in your case R3/PT1M and it was interrupting boundary event, so the process instance will end when first iteration was successful.

Reminding the user and ending the process is your business requirement? As per bpmn practice, for sending remainders to user, prefer non-interrupting events.


#5

No @aravindhrs , I couldn’t see it atleast once. I’m getting the ClassNotFoundException for the first time itself. I tried with the delegate expression too but the result is same.

Error log:
org.camunda.bpm.engine.ProcessEngineException: ENGINE-09008 Exception while instantiating class ‘com.process.listener.ReminderTaskDelegate’: ENGINE-09017 Cannot load class ‘com.process.listener.ReminderTaskDelegate’: com.process.listener.ReminderTaskDelegate
at org.camunda.bpm.engine.impl.util.EngineUtilLogger.exceptionWhileInstantiatingClass(EngineUtilLogger.java:81)
at org.camunda.bpm.engine.impl.util.ClassDelegateUtil.instantiateDelegate(ClassDelegateUtil.java:53)
at org.camunda.bpm.engine.impl.bpmn.behavior.ClassDelegateActivityBehavior.getActivityBehaviorInstance(ClassDelegateActivityBehavior.java:111)
at org.camunda.bpm.engine.impl.bpmn.behavior.ClassDelegateActivityBehavior$1.call(ClassDelegateActivityBehavior.java:67)
at org.camunda.bpm.engine.impl.bpmn.behavior.ClassDelegateActivityBehavior$1.call(ClassDelegateActivityBehavior.java:64)
at org.camunda.bpm.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.executeWithErrorPropagation(AbstractBpmnActivityBehavior.java:110)
at org.camunda.bpm.engine.impl.bpmn.behavior.ClassDelegateActivityBehavior.execute(ClassDelegateActivityBehavior.java:64)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute$2.callback(PvmAtomicOperationActivityExecute.java:60)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute$2.callback(PvmAtomicOperationActivityExecute.java:49)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.continueIfExecutionDoesNotAffectNextOperation(PvmExecutionImpl.java:1988)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:41)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:30)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:107)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:640)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:614)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl$6.callback(PvmExecutionImpl.java:1927)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl$6.callback(PvmExecutionImpl.java:1924)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.continueExecutionIfNotCanceled(PvmExecutionImpl.java:1994)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.dispatchDelayedEventsAndPerformOperation(PvmExecutionImpl.java:1943)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.dispatchDelayedEventsAndPerformOperation(PvmExecutionImpl.java:1924)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(PvmAtomicOperationTransitionNotifyListenerStart.java:60)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(PvmAtomicOperationTransitionNotifyListenerStart.java:30)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:67)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:107)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:72)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:649)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:624)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:60)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:107)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:72)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:649)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:624)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:60)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:107)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:640)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:614)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionCreateScope.scopeCreated(PvmAtomicOperationTransitionCreateScope.java:37)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScope.java:53)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScope.java:27)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:95)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:127)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:114)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:82)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:72)
at org.camunda.bpm.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:80)
at org.camunda.bpm.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:39)
at org.camunda.bpm.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:138)
at org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:102)
at org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:39)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:27)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:106)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:45)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:43)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:69)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:50)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:43)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:91)
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:60)
at org.springframework.cloud.sleuth.instrument.async.TraceRunnable.run(TraceRunnable.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.camunda.bpm.engine.ClassLoadingException: ENGINE-09017 Cannot load class ‘com.process.listener.ReminderTaskDelegate’: com.process.listener.ReminderTaskDelegate
at org.camunda.bpm.engine.impl.util.EngineUtilLogger.classLoadingException(EngineUtilLogger.java:138)
at org.camunda.bpm.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:110)
at org.camunda.bpm.engine.impl.util.ClassDelegateUtil.instantiateDelegate(ClassDelegateUtil.java:45)
… 74 more
Caused by: java.lang.ClassNotFoundException: com.process.listener.ReminderTaskDelegate
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.camunda.bpm.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:87)

application.properties:
camunda.bpm.admin-user.id=kermit
camunda.bpm.admin-user.password=kermit
camunda.bpm.job-execution.enabled=false

Configuration class:
package com.process.config;

import javax.inject.Inject;
import javax.sql.DataSource;

import org.camunda.bpm.engine.ProcessEngineConfiguration;
import org.camunda.bpm.engine.impl.plugin.AdministratorAuthorizationPlugin;
import org.camunda.bpm.identity.impl.ldap.plugin.LdapIdentityProviderPlugin;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

import com.fasterxml.jackson.databind.ObjectMapper;

import com.process.condition.LdapPluginCondition;

@Configuration
public class ProcessConfig {

@Value("${ldap.auth.serverUrl:}")
private String ldapServerUrl;

@Value("${ldap.auth.acceptUntrustedCertificates:}")
private String ldapAcceptUntrustedCertificates;

@Value("${ldap.auth.managerDn:}")
private String ldapManagerDn;

@Value("${ldap.auth.managerPassword:}")
private String ldapManagerPassword;

@Value("${ldap.auth.userSearchBase:}")
private String ldapUserSearchBase;

@Value("${ldap.auth.baseDn:}")
private String ldapBaseDn;

@Value("${ldap.auth.userSearchFilter:}")
private String ldapUserSearchFilter;

@Value("${ldap.auth.userIdAttribute:}")
private String ldapUserIdAttribute;

@Value("${ldap.auth.userFirstnameAttribute:}")
private String ldapUserFirstnameAttribute;

@Value("${ldap.auth.userLastnameAttribute:}")
private String ldapUserLastnameAttribute;

@Value("${ldap.auth.userEmailAttribute:}")
private String ldapUserEmailAttribute;

@Value("${ldap.auth.userPasswordAttribute:}")
private String ldapUserPasswordAttribute;

@Value("${ldap.auth.groupSearchBase:}")
private String ldapGroupSearchBase;

@Value("${ldap.auth.groupSearchFilter:}")
private String ldapGroupSearchFilter;

@Value("${ldap.auth.groupIdAttribute:}")
private String ldapGroupIdAttribute;

@Value("${ldap.auth.groupNameAttribute:}")
private String ldapGroupNameAttribute;

@Value("${ldap.auth.groupMemberAttribute:}")
private String ldapGroupMemberAttribute;

@Value("${ldap.auth.authorizationCheckEnabled:}")
private String ldapAuthorizationCheckEnabled;

@Value("${ldap.auth.administratorUserName:}")
private String ldapAdministratorUserName;

@Inject
private DataSource datasource;

@Bean
public ProcessEngineConfiguration processEngineConfiguration() {
    return ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration().setDataSource(datasource).setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE)
        .setHistory(ProcessEngineConfiguration.HISTORY_FULL)
        .setJobExecutorActivate(false).setJobExecutorDeploymentAware(false);
}

@Bean
@Conditional(LdapPluginCondition.class)
public LdapIdentityProviderPlugin ldapIdentityProviderPlugin() {
    LdapIdentityProviderPlugin ldapIdentityProviderPlugin = new LdapIdentityProviderPlugin();
    ldapIdentityProviderPlugin.setServerUrl(ldapServerUrl);
    ldapIdentityProviderPlugin.setAcceptUntrustedCertificates(Boolean.valueOf(ldapAcceptUntrustedCertificates));
    ldapIdentityProviderPlugin.setManagerDn(ldapManagerDn);
    ldapIdentityProviderPlugin.setManagerPassword(ldapManagerPassword);
    ldapIdentityProviderPlugin.setBaseDn(ldapBaseDn);
    ldapIdentityProviderPlugin.setUserSearchBase(ldapUserSearchBase);
    ldapIdentityProviderPlugin.setUserSearchFilter(ldapUserSearchFilter);
    ldapIdentityProviderPlugin.setUserIdAttribute(ldapUserIdAttribute);
    ldapIdentityProviderPlugin.setUserFirstnameAttribute(ldapUserFirstnameAttribute);
    ldapIdentityProviderPlugin.setUserLastnameAttribute(ldapUserLastnameAttribute);
    ldapIdentityProviderPlugin.setUserEmailAttribute(ldapUserEmailAttribute);
    ldapIdentityProviderPlugin.setUserPasswordAttribute(ldapUserPasswordAttribute);
    ldapIdentityProviderPlugin.setGroupSearchBase(ldapGroupSearchBase);
    ldapIdentityProviderPlugin.setGroupSearchFilter(ldapGroupSearchFilter);
    ldapIdentityProviderPlugin.setGroupIdAttribute(ldapGroupIdAttribute);
    ldapIdentityProviderPlugin.setGroupNameAttribute(ldapGroupNameAttribute);
    ldapIdentityProviderPlugin.setGroupMemberAttribute(ldapGroupMemberAttribute);
    ldapIdentityProviderPlugin.setAuthorizationCheckEnabled(Boolean.valueOf(ldapAuthorizationCheckEnabled));
    return ldapIdentityProviderPlugin;
}

@ConditionalOnBean(LdapIdentityProviderPlugin.class)
@Bean
public AdministratorAuthorizationPlugin administratorAuthorizationPlugin() {
    AdministratorAuthorizationPlugin administratorAuthorizationPlugin = new AdministratorAuthorizationPlugin();
    administratorAuthorizationPlugin.setAdministratorUserName(ldapAdministratorUserName);
    return administratorAuthorizationPlugin;
}

@Bean
public ObjectMapper objectMapper() {
    return new ObjectMapper();
}

}

Something missing in the configuration?


#6

you need to configure .setJobExecutorActivate(true) because timer events are executed by job executor.


#7

@aravindhrs have set jobExecutorActivate and deploymentAware to ‘true’ , still the issue persists :frowning:


#8

can you try this timertest.bpmn (3.8 KB)


#9

this is not required in your case. this field is to set configure job executor to execute jobs on the deployed nodes related topics.


#10

@aravindhrs even this didn’t work ! I hope the changes in this bpmn are related to Timer Definition Type and Timer Definition.

Do we need to include any other camunda related dependencies than the below ?

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

    <dependency>
        <groupId>org.camunda.bpm.identity</groupId>
        <artifactId>camunda-identity-ldap</artifactId>
        <version>7.10.0</version>
    </dependency>

#11

you need to include this dependency,

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jdbc</artifactId>
    <version>2.1.7.RELEASE</version>
</dependency>

Also make sure DB drivers dependencies also added in classpath


#12

@aravindhrs Thanks a ton for spending time on my issue bro :slight_smile: . The issue has been resolved now. I haven’t added the spring-boot-starter-jdbc dependency but modified and added some db properties in my application yml file like below and it started working

spring.datasource:
url: jdbc:sqlserver://BIABZTSQL01\DBS1;databaseName=camunda
username: camunda
password: camunda
initialize: true
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
show-sql: true

spring.jpa:
show-sql: true
generate-ddl: true
database-platform: org.hibernate.dialect.SQLServerDialect
hibernate:
ddl-auto: create
properties:
hibernate:
show_sql: false
use_sql_comments: false
format_sql: false