title: Kafka Connect JDBC Sink Connector: Class Loader Not Found
body: <p>Using Confluent Docker all in one package with tag 5.4.1; I am struggling to get a jdbc sink connector up and running. </p>
  
  <p>When I launch the following connector:</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    "name": "mySink",
    "connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
    "value.converter": "org.apache.kafka.connect.json.JsonConverter",
    "topics": [
      "myTopic"
    ],
    "connection.url": "jdbc:sqlserver://sqlserver:1433;databaseName=myDB",
    "connection.user": "user",
    "connection.password": "**********",
    "dialect.name": "SqlServerDatabaseDialect",
    "insert.mode": "insert",
    "table.name.format": "TableSink",
    "pk.mode": "kafka",
    "fields.whitelist": [
      "offset",
      "value"
    ],
    "auto.create": "true"
  }
  </code></pre>
  
  <p><em>(Some attributes edited)</em></p>
  
  <p>I get the following exception on from the connect container:<br>
  <code>ERROR Plugin class loader for connector: 'io.confluent.connect.jdbc.JdbcSinkConnector' was not found.</code>  </p>
  
  <p>I have the following environment variable for connect:<br>
  <code>CONNECT_PLUGIN_PATH: "/usr/share/java,/usr/share/confluent-hub-components"</code></p>
  
  <p>And if I check in the container I have:<br>
  <code>/usr/share/java/kafka-connect-jdbc</code></p>
  
  <p>With the following files:  </p>
  
  <pre><code>./jtds-1.3.1.jar
  ./common-utils-5.4.0.jar
  ./slf4j-api-1.7.26.jar
  ./kafka-connect-jdbc-5.4.0.jar
  ./postgresql-9.4.1212.jar
  ./sqlite-jdbc-3.25.2.jar
  ./mssql-jdbc-8.2.0.jre8.jar
  ./mssql-jdbc-8.2.0.jre13.jar
  ./mssql-jdbc-8.2.0.jre11.jar
  </code></pre>
  
  <p>The only changes I have made from the base connect image are the mssql jdbc drivers. These are working fine for a jdbc source connector.</p>
  
  <p>Extra information as requested:<br>
  Output from <code>curl -s localhost:8083/connector-plugins|jq '.[].class'</code></p>
  
  <pre><code>"io.confluent.connect.activemq.ActiveMQSourceConnector"
  "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector"
  "io.confluent.connect.gcs.GcsSinkConnector"
  "io.confluent.connect.ibm.mq.IbmMQSourceConnector"
  "io.confluent.connect.jdbc.JdbcSinkConnector"
  "io.confluent.connect.jdbc.JdbcSourceConnector"
  "io.confluent.connect.jms.JmsSourceConnector"
  "io.confluent.connect.s3.S3SinkConnector"
  "io.confluent.connect.storage.tools.SchemaSourceConnector"
  "io.confluent.kafka.connect.datagen.DatagenConnector"
  "org.apache.kafka.connect.file.FileStreamSinkConnector"
  "org.apache.kafka.connect.file.FileStreamSourceConnector"
  "org.apache.kafka.connect.mirror.MirrorCheckpointConnector"
  "org.apache.kafka.connect.mirror.MirrorHeartbeatConnector"
  "org.apache.kafka.connect.mirror.MirrorSourceConnector"
  </code></pre>
  
  <p>docker-compose from:
  <a href="https://github.com/confluentinc/examples/tree/5.4.1-post/cp-all-in-one" rel="nofollow noreferrer">https://github.com/confluentinc/examples/tree/5.4.1-post/cp-all-in-one</a></p>
  
  <p>Images:</p>
  
  <pre><code>confluentinc/cp-ksql-cli:5.4.1                 
  confluentinc/cp-enterprise-control-center:5.4.1
  confluentinc/cp-ksql-server:5.4.1              
  cnfldemos/cp-server-connect-datagen:0.2.0-5.4.0
  confluentinc/cp-kafka-rest:5.4.1               
  confluentinc/cp-schema-registry:5.4.1          
  confluentinc/cp-server:5.4.1                   
  confluentinc/cp-zookeeper:5.4.1                
  </code></pre>