title: Cassandra 3.10 Create Trigger, class doesn't exist
body: <p>I have DSE 5.1 with Cassandra 3.10 and cql 5.0.1 installed on CentOS 7.3.1611 (Core).</p>
  
  <p>I'm following the tutorial from DSE Triggers:</p>
  
  <p><a href="http://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/cql_commands/cqlCreateTrigger.html?hl=trigger" rel="nofollow noreferrer">http://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/cql_commands/cqlCreateTrigger.html?hl=trigger</a></p>
  
  <p>Which send me to github:
  <a href="https://github.com/apache/cassandra/tree/trunk/examples/triggers" rel="nofollow noreferrer">https://github.com/apache/cassandra/tree/trunk/examples/triggers</a></p>
  
  <p>According to the tutorial, I am compiling the jar with ANT 1.10.1. The compiled jar contain the code:</p>
  
  <pre><code>package org.apache.cassandra.triggers;
  
  import java.io.InputStream;
  import java.util.Collection;
  import java.util.Collections;
  import java.util.Properties;
  
  import org.apache.cassandra.schema.TableMetadata;
  import org.apache.cassandra.schema.Schema;
  import org.apache.cassandra.db.Mutation;
  import org.apache.cassandra.db.partitions.Partition;
  import org.apache.cassandra.db.partitions.PartitionUpdate;
  import org.apache.cassandra.io.util.FileUtils;
  import org.apache.cassandra.utils.FBUtilities;
  import org.apache.cassandra.utils.UUIDGen;
  
  public class AuditTrigger implements ITrigger
  {
      private Properties properties = loadProperties();
  
      public Collection&lt;Mutation&gt; augment(Partition update)
      {
          String auditKeyspace = properties.getProperty("keyspace");
          String auditTable = properties.getProperty("table");
  
          TableMetadata metadata = Schema.instance.getTableMetadata(auditKeyspace, auditTable);
          PartitionUpdate.SimpleBuilder audit = PartitionUpdate.simpleBuilder(metadata, UUIDGen.getTimeUUID());
  
          audit.row()
               .add("keyspace_name", update.metadata().keyspace)
               .add("table_name", update.metadata().table)
               .add("primary_key", update.metadata().partitionKeyType.getString(update.partitionKey().getKey()));
  
          return Collections.singletonList(audit.buildAsMutation());
      }
  
      private static Properties loadProperties()
      {
          Properties properties = new Properties();
          InputStream stream = AuditTrigger.class.getClassLoader().getResourceAsStream("AuditTrigger.properties");
          try
          {
              properties.load(stream);
          }
          catch (Exception e)
          {
              throw new RuntimeException(e);
          }
          finally
          {
              FileUtils.closeQuietly(stream);
          }
          return properties;
      }
  }
  </code></pre>
  
  <p>The compiled jar, I am copying to the cassandra triggers location (/etc/cassandra/triggers). Then I run from cql the command:</p>
  
  <pre><code>CREATE TRIGGER test1 ON test.test USING 'org.apache.cassandra.triggers.AuditTrigger';
  </code></pre>
  
  <p>And send me the error:</p>
  
  <pre><code>ConfigurationException: Trigger class 'org.apache.cassandra.triggers.AuditTrigger' doesn't exist
  </code></pre>
  
  <p>I copied the jar in all the nodes of my cluster, restarted the cluster and ran the command: </p>
  
  <pre><code>nodetool reloadtriggers
  </code></pre>
  
  <p>With no success, I also put in the jvm.options the command:</p>
  
  <pre><code>-Dcassandra.triggers_dir=/etc/dse/cassandra/triggers
  </code></pre>
  
  <p>And in the cassandra-env.sh, I added the command:</p>
  
  <pre><code>JVM_OPTS="$JVM_OPTS -Dcassandra.triggers_dir=/etc/dse/cassandra/triggers"
  </code></pre>
  
  <p>And I am getting the same error. I tryied adding the jar in the cassandra lib folder (/usr/share/dse/cassandra/lib/) and it seems to not been loading the compiled jar.</p>
  
  <p>When I run the command in cql:</p>
  
  <pre><code> CREATE TRIGGER test1 ON test.test USING 'org.apache.cassandra.triggers.AuditTrigger';
  </code></pre>
  
  <p>I am still getting the same error</p>
  
  <pre><code>ConfigurationException: Trigger class 'org.apache.cassandra.triggers.AuditTrigger' doesn't exist
  </code></pre>
  
  <p>So, my question is, How can I make cassandra load my jar correctly and use it to create a trigger in cql?</p>