snowflakedb / snowflake-kafka-connector

Snowflake Kafka Connector (Sink Connector)
Apache License 2.0
140 stars 98 forks source link

NoClassDefFoundError: org/bouncycastle/openssl/PEMParser #987

Closed abhishekkh closed 2 weeks ago

abhishekkh commented 2 weeks ago

Added jars as per documentation.

ls  /opt/kafka/plugins/snowflake

bc-fips-1.0.1.jar
bcpkix-fips-1.0.3.jar
snowflake-kafka-connector-2.5.0.jar

Plugins are loaded from plugin path

Loading plugin from: /opt/kafka/plugins/snowflake (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader) [main]
2024-11-05 00:43:11,195 INFO Registered loader: PluginClassLoader{pluginLocation=file:/opt/kafka/plugins/snowflake/} (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader) [main]

Running into java.lang.NoClassDefFoundError: org/bouncycastle/openssl/PEMParser

ERROR [snowflake-sink-connector|worker] WorkerConnector{id=snowflake-sink-connector} Error while starting connector (org.apache.kafka.connect.runtime.WorkerConnector) [connector-thread-snowflake-sink-connector]
java.lang.NoClassDefFoundError: org/bouncycastle/openssl/PEMParser
    at com.snowflake.kafka.connector.internal.EncryptionUtils.parseEncryptedPrivateKey(EncryptionUtils.java:32)
    at com.snowflake.kafka.connector.internal.InternalUtils.createProperties(InternalUtils.java:195)
    at com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceFactory$SnowflakeConnectionServiceBuilder.setProperties(SnowflakeConnectionServiceFactory.java:71)
    at com.snowflake.kafka.connector.SnowflakeSinkConnector.start(SnowflakeSinkConnector.java:115)
    at org.apache.kafka.connect.runtime.WorkerConnector.doStart(WorkerConnector.java:184)
    at org.apache.kafka.connect.runtime.WorkerConnector.start(WorkerConnector.java:209)
    at org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:348)
    at org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:331)
    at org.apache.kafka.connect.runtime.WorkerConnector.doRun(WorkerConnector.java:140)
    at org.apache.kafka.connect.runtime.WorkerConnector.run(WorkerConnector.java:117)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMParser
    at java.base/java.net.URLClassLoader.findClass(Unknown Source)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    at org.apache.kafka.connect.runtime.isolation.PluginClassLoader.loadClass(PluginClassLoader.java:103)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)

Am I missing any other dependencies?

sfc-gh-mbobowski commented 2 weeks ago

Hi @abhishekkh, thanks for reaching out.

You are not missing any dependencies. I verified that there was no dependency bumped in v2.5.0 that shades the bcpkix-fips jar. Do you experience the same error in v2.4.1?

abhishekkh commented 2 weeks ago

@sfc-gh-mbobowski Adding the below jars seems to have resolved the problem. Might need an update to the docs.

bcprov-jdk15on-1.70.jar
bcpkix-jdk15on-1.70.jar