Missing JAR errors

A job fails with a missing class when the JAR file of a custom connector or data format is not available to the job.

Symptoms

A job fails with a ClassNotFoundException or a NoClassDefFoundError for a class from a JAR file that you uploaded to Cloudera SQL Stream Builder (SSB), or with the error Found conflicting artifact files.

Cause

One of the following:

  • Storage is not configured. SSB needs storage to use uploaded files, and without it, the upload fails.
  • The upload did not complete, or a later upload with the same name replaced the JAR file as the active file.
  • Two uploaded files that the job uses have the same file name.
  • The class is not in the JAR file, for example because the JAR file does not include a dependency of the connector.

Solution

  1. Check that a bucket is bound to the default purpose of the engine.
    See Preparing storage for Cloudera Streaming Analytics.
  2. Upload the JAR file again, and give each JAR file a unique name.
  3. Check that the JAR file contains the class from the error message:
    jar tf <file>.jar | grep <ClassName>
  4. If the class is missing, build the JAR file again with its dependencies included.
  5. Run the job again.
    For more information about uploads, see Adding a new connector and Adding a new data format.