influxdata / influxdata/influxdb-client-java
Getting NoClassDefFoundError / ClassNotFoundException on java.sql.Date while running SBT assembly jar
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 477
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
I am getting below error while creating an SBT assembly (fat) jar. The same code works in Intellij Idea just fine.
java.lang.NoClassDefFoundError: java/sql/Date
at com.influxdb.client.JSON.(JSON.java:113)
at com.influxdb.client.internal.AbstractInfluxDBClient.(AbstractInfluxDBClient.java:117)
at com.influxdb.client.internal.AbstractInfluxDBClient.(AbstractInfluxDBClient.java:79)
at com.influxdb.client.internal.InfluxDBClientImpl.(InfluxDBClientImpl.java:99)
at com.influxdb.client.InfluxDBClientFactory.create(InfluxDBClientFactory.java:261)
....
Caused by: java.lang.ClassNotFoundException: java.sql.Date
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 53 more
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 assembly-jar runtime and the stack trace at com.influxdb.client.JSON (JSON.java:113), then inspect how the assembled artifact loads java.sql.Date compared with IntelliJ. Reproduce the NoClassDefFoundError/ClassNotFoundException and document the packaging or runtime difference that accounts for it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100