Getting this error due to Hadoop dependency: I hav...
# troubleshooting
s
Getting this error due to Hadoop dependency: I have followed this post but still no luck. I’m using K8 operator for deployments.
Copy code
Caused by: java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
	at com.smaato.nrt.kafka2s3streamsync.JobFlowGraph.getS3FileSink(JobFlowGraph.scala:86) ~[?:?]
	at com.smaato.nrt.kafka2s3streamsync.JobFlowGraph.sinkToKafka(JobFlowGraph.scala:98) ~[?:?]
	at com.smaato.nrt.kafka2s3streamsync.JobFlowGraph.build(JobFlowGraph.scala:111) ~[?:?]
	at com.smaato.nrt.kafka2s3streamsync.DataStreamJob$.main(DataStreamJob.scala:12) ~[?:?]
	at com.smaato.nrt.kafka2s3streamsync.DataStreamJob.main(DataStreamJob.scala) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
g
try adding
flink-shaded-hadoop-2-uber-2.8.3-10.0.jar
s
ok, I’ll give a try
still got the same error
I used the given lib along with
Copy code
<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-hadoop-compatibility_${scala.binary.version}</artifactId>
			<version>${flink.version}</version>
		</dependency>
also enabled built-in plugin:
flink-s3-fs-hadoop-1.17.1.jar
s
also enabled built-in plugin:
flink-s3-fs-hadoop-1.17.1.jar
@Sricharan the link which you shared, I’ve tried this as well
g
can u verify these jars are available on the cluster? never encountered this exception when the jar was available on the
/libs
folder
s
@Giannis Polyzos you are right! it is not copied to libs folder
I’m following this document
But I’m using k8 opeartor with CRD.
Copy code
containers:
        # Do not change the main container name
        - name: flink-main-container
          env:
            # <https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/deployment/resource-providers/standalone/docker/#using-filesystem-plugins>
            - name: ENABLE_BUILT_IN_PLUGINS
              value: flink-s3-fs-hadoop-1.17.1.jar
but this setting is not copying the jar file
g
You could create a simple dockerfile, like:
Copy code
FROM flink:1.17.1
ADD jars/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar /opt/flink/lib/
to add the jar and use it for the k8s images
🙌 1
👍 1
s
sure I’ll try this
s
@Sunil Srinivasa You have to add all the dependencies in the docker file to be available, like Ginnis shared.
s
@Giannis Polyzos /@Sricharan issue was resolved after adding the Jar in the image. Thanks for the help!
🙏 2