Legacy Knowledge Base
Published Jun. 30, 2025

Dispatch Trigger Error: No DispatchTrigger Exists with Primary Key XXXXX

Written By

Sorin Pop

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • We are encountering an error related to Liferay's dispatch framework, where the system is attempting to process a non-existent dispatch trigger. The error message is as follows:

ERROR [liferay/dispatch/executor-2][ParallelDestination:50] Unable to process message {destinationName=liferay/dispatch/executor, response=null, responseDestinationName=null, responseId=null, payload={"dispatchTriggerId": 160841}, values={GROUP_NAME=DISPATCH_GROUP_0160841, companyId=47649, groupId=0, DESTINATION_NAME=liferay/dispatch/executor, JOB_STATE=com.liferay.portal.kernel.scheduler.JobState@414b72e6, STORAGE_TYPE=PERSISTED, JOB_NAME=DISPATCH_JOB_0160841}}
com.liferay.portal.kernel.messaging.MessageListenerException: com.liferay.dispatch.exception.NoSuchTriggerException: No DispatchTrigger exists with the primary key 160841
        at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32) ~[portal-kernel.jar:?]
        at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:62) ~[portal-kernel.jar:?]
        at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:47) [bundleFile:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: com.liferay.dispatch.exception.NoSuchTriggerException: No DispatchTrigger exists with the primary key 160841
        at com.liferay.dispatch.service.persistence.impl.DispatchTriggerPersistenceImpl.findByPrimaryKey(DispatchTriggerPersistenceImpl.java:8247) ~[?:?]
        at com.liferay.dispatch.service.persistence.impl.DispatchTriggerPersistenceImpl.findByPrimaryKey(DispatchTriggerPersistenceImpl.java:8265) ~[?:?]
        at com.liferay.dispatch.service.impl.DispatchTriggerLocalServiceImpl.getDispatchTrigger(DispatchTriggerLocalServiceImpl.java:206) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:41) ~[portal-impl.jar:?]
        at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:60) ~[portal-impl.jar:?]
        at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:48) ~[portal-impl.jar:?]
        at com.liferay.change.tracking.internal.aop.CTTransactionAdvice.invoke(CTTransactionAdvice.java:70) ~[?:?]
        at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:48) ~[portal-impl.jar:?]
        at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:40) ~[portal-impl.jar:?]
        at com.sun.proxy.$Proxy552.getDispatchTrigger(Unknown Source) ~[?:?]
        at com.liferay.dispatch.internal.messaging.DispatchMessageListener.doReceive(DispatchMessageListener.java:47) ~[?:?]
        at com.liferay.portal.kernel.messaging.BaseMessageListener.doReceive(BaseMessageListener.java:39) ~[portal-kernel.jar:?]
        at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:25) ~[portal-kernel.jar:?]

The system continues to reference this non-existent trigger, causing errors in the dispatch execution process and logging it every 5 minutes.

Environment

  • QR

Resolution

The DispatchTrigger tables might be misaligned with the quartz tables . In principle, whenever a record is deleted from the DispatchTrigger table, the quartz dependencies are deleted in cascade. It could be the case that at the time of deleting the DispatchTrigger element the server has stopped. In order to delete that record completely and not have any traces of that type, you can try running the following groovy script:

import com.liferay.portal.kernel.scheduler.messaging.SchedulerResponse;
import com.liferay.portal.kernel.scheduler.SchedulerEngineHelperUtil;
import com.liferay.portal.kernel.scheduler.StorageType;
 
String dispatchJob = "DISPATCH_JOB_0160841"
String dispatchGroup = "DISPATCH_GROUP_0160841"
try {
SchedulerResponse sr = SchedulerEngineHelperUtil.getScheduledJob(dispatchJob, dispatchGroup, StorageType.PERSISTED);
if(sr!=null){
out.println("Scheduler unlinked to delete: "+sr);
SchedulerEngineHelperUtil.delete(sr.getJobName(), sr.getGroupName(), sr.getStorageType());
}else{
out.println("Scheduler unlinked not found");
}
} catch (Exception e) {
throw new RuntimeException(e);
}
Did this article resolve your issue ?

Legacy Knowledge Base