influxdata / influxdata/influxdb-java

Caused by: java.lang.NoClassDefFoundError: Could not initialize class okhttp3.OkHttpClient

Open
#714 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.2k
Forks
469
PR merge metrics
No merged PRs in 30d

Description

==Usage scenario==
Flink sink to influxDB.
The code runs locally without problem, and after being submitted to the cluster, receives the following error.
Operating system: Centos8,
Flink version: 1.10.0,
Hadoop version: 2.8.3
InfluxDB version: 1.7.1

==flink-conf.xml==
classloader.resolve-order: child-first

==error log==
Caused by: java.lang.NoClassDefFoundError: Could not initialize class okhttp3.OkHttpClient
at okhttp3.OkHttpClient$Builder.(OkHttpClient.java:449)
at com.rexel.stream.utils.InfluxUtils.connect(InfluxUtils.java:57)
at com.rexel.stream.flink.sink.SinkToInflux.open(SinkToInflux.java:38)
at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36)
at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102)
at org.apache.flink.streaming.api.operators.StreamSink.open(StreamSink.java:48)
at org.apache.flink.streaming.runtime.tasks.StreamTask.initializeStateAndOpen(StreamTask.java:1007)
at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$beforeInvoke$0(StreamTask.java:454)
at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.runThrowing(StreamTaskActionExecutor.java:94)
at org.apache.flink.streaming.runtime.tasks.StreamTask.beforeInvoke(StreamTask.java:449)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:461)
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:707)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:532)
at java.lang.Thread.run(Thread.java:748)

pom.xml


rexel-ids
com.rexel
1.0.0

4.0.0
rexel-stream

true
1.10
1.10.0
1.2.72
2.8
1.2.3
1.18.12
8.0.19
4.5.0
0.49.0
4.5.0
2.0.12




org.apache.flink
flink-java
${flink.version}


org.apache.flink
flink-streaming-java_2.11
${flink.version}


org.apache.flink
flink-clients_2.11
${flink.version}



ch.qos.logback
logback-core
${logback.version}


ch.qos.logback
logback-access
${logback.version}


ch.qos.logback
logback-classic
${logback.version}



com.alibaba
fastjson
${fastjson.version}



org.projectlombok
lombok
${lombok.version}



org.apache.qpid
qpid-jms-client
${qpid-jms-client.version}



mysql
mysql-connector-java
${mysql-connector-java.version}



org.apache.rocketmq
rocketmq-client
${rocketmq.version}


org.apache.rocketmq
rocketmq-acl
${rocketmq.version}


commons-cli
commons-cli




org.apache.rocketmq
rocketmq-tools
${rocketmq.version}


org.apache.rocketmq
rocketmq-common
${rocketmq.version}



commons-codec
commons-codec
${commons-codec.version}



com.taosdata.jdbc
taos-jdbcdriver
${taos-jdbcdriver.version}



org.influxdb
influxdb-java
${influxdb-java.version}


com.squareup.okio
okio







maven-compiler-plugin
3.1

1.8
1.8




maven-assembly-plugin
2.4


jar-with-dependencies




make-assembly
package

single





Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pom.xml and the error path through InfluxUtils.connect and SinkToInflux.open. Compare the listed dependency exclusions and classloader.resolve-order setting with the local and cluster environments, then trace the full initialization cause for okhttp3.OkHttpClient. Done means identifying a reproducible cause and documenting or implementing a fix for the cluster failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.