apache/cassandra · error · ConfigurationException

Trigger class couldn't be found.

Error message

Trigger class %s couldn't be found.

What it means

TriggerExecutor.executeInternal loads a trigger's class by name while swapping the context classloader. If the configured trigger class name cannot be found on the classpath, ClassNotFoundException is caught and rethrown as a ConfigurationException with this message.

Solutions

  1. Verify the trigger class name in the table metadata (DESCRIBE TABLE / system_schema.triggers) matches the deployed class exactly
  2. Copy the trigger JAR to lib/triggers on every node and restart (or nodetool reloadtriggers if applicable)
  3. Check logs for the fully-qualified name and correct package spelling
  4. Remove the trigger definition if the class is intentionally gone

Example fix

// before
CREATE TRIGGER trig1 ON ks.t USING 'com.example.MyTrigger';
// after
CREATE TRIGGER trig1 ON ks.t USING 'com.example.triggers.MyTriggerClass'; // class must exist in a jar on every node
Defensive patterns

Strategy: validation

Validate before calling

// verify class availability before issuing mutations that fire triggers
try {
    Class.forName("com.example.triggers.MyTriggerClass");
} catch (ClassNotFoundException e) {
    throw new IllegalStateException("Trigger class missing on this node: deploy jar to lib/triggers", e);
}

Try / catch

// catch ConfigurationException around mutations on trigger-bearing tables
try {
    session.execute(insert);
} catch (org.apache.cassandra.exceptions.ConfigurationException e) {
    if (e.getMessage().contains("Trigger class")) {
        // deploy/fix trigger jar or drop trigger
    } else throw e;
}

Prevention

When it happens

Trigger: Executing a mutation through a table that has a trigger whose triggerClass string is misspelled, refers to a trigger JAR that was dropped/removed from lib/triggers, or was never deployed to all nodes in the cluster.

Common situations: Deploying a schema with CREATE TRIGGER on only some nodes; removing a custom trigger jar during rolling upgrades; typos in the fully-qualified class name in the trigger metadata.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/b6b78cb01cbb9bca. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/triggers/TriggerExecutor.java:277

                triggerClass = td.classOption;
                if (trigger == null)
                {
                    trigger = loadTriggerInstance(td.classOption);
                    cachedTriggers.put(td.classOption, trigger);
                }
                Collection<Mutation> temp = trigger.augment(update);
                if (temp != null)
                    tmutations.addAll(temp);
            }
            return tmutations;
        }
        catch (CassandraException ex)
        {
            throw ex;
        }
        catch (ClassNotFoundException ex)
        {
            throw new ConfigurationException("Trigger class " + triggerClass + " couldn't be found.");
        }
        catch (Exception ex)
        {
            throw new RuntimeException(String.format("Exception while executing trigger on table with ID: %s", update.metadata().id), ex);
        }
        finally
        {
            Thread.currentThread().setContextClassLoader(parent);
        }
    }

    public synchronized Class<? extends ITrigger> loadTriggerClass(String triggerClass) throws Exception
    {
        // Allow loading the class regardless of Config, since this could happen as part of TCM replay via
        // CreateTriggerStatement#apply.
        // Check that triggerClass is available on the classpath, but do not initialize the class since that would
        // execute static blocks.
        Class<? extends ITrigger> trigger = loadTriggerClassWithoutInitialization(triggerClass);

View on GitHub (pinned to 88fd0f6a0e)