influxdata / influxdata/influxdb-java
java.lang.NoSuchFieldError: Companion at com.squareup.okhttp3.internal.Util
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 469
- PR merge metrics
- No merged PRs in 30d
Description
The `pom.xml` that my project used is shown below
```
4.0.0
xx
xxx
xxxx
xxx
org.slf4j
slf4j-api
1.7.15
commons-collections
commons-collections
3.2.1
org.influxdb
influxdb-java
2.21
junit
junit
4.12
org.apache.maven.plugins
maven-compiler-plugin
3.8.1
8
8
org.apache.maven.plugins
maven-shade-plugin
3.2.4
package
shade
okhttp3
flink.influxdb.shaded.okhttp3
```
I have make sure that no other okhttp3 version exists in the repo, and the only okhttp3 version I am using is 4.9.0 (which is introduced by influxdb-java). To avoid any possible conflict, I have shaded the okhttp3 path.
I am running the job in a spark environment, and I encountered the error shown below,
```
23/05/16 11:58:10 ERROR ApplicationMaster: User class threw exception: java.lang.NoSuchFieldError: Companion
java.lang.NoSuchFieldError: Companion
at flink.influxdb.shaded.okhttp3.internal.Util.(Util.kt:71)
at flink.influxdb.shaded.okhttp3.internal.concurrent.TaskRunner.(TaskRunner.kt:309)
at flink.influxdb.shaded.okhttp3.ConnectionPool.(ConnectionPool.kt:41)
at flink.influxdb.shaded.okhttp3.ConnectionPool.(ConnectionPool.kt:47)
at flink.influxdb.shaded.okhttp3.OkHttpClient$Builder.(OkHttpClient.kt:471)
at org.influxdb.InfluxDBFactory.connect(InfluxDBFactory.java:30)
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the pom.xml, especially the influxdb-java dependency and Maven Shade Plugin relocation, then trace the reported failure from InfluxDBFactory.connect through the shaded okhttp3 classes. Reproduce the NoSuchFieldError in the stated Spark environment and establish what dependency or shading change is required for the client to initialize successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100