question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: ClassNotFoundException: io.fabric8.kubernetes.model.annotation.Group in 5.12.2 version

See original GitHub issue

Is your task related to a problem? Please describe

Im using io.fabric8:kubernetes-client:5.12.2 and on running a simple client creation code: KubernetesClient client = new DefaultKubernetesClient();

im getting the following errors: Caused by: java.lang.ClassNotFoundException: io.fabric8.kubernetes.model.annotation.Group at java.net.URLClassLoader.findClass(URLClassLoader.java:471) ~[?:?]

So what can be done to fix this?

Describe the solution you’d like

We should not be seeing the ClassNotFoundException. Some regression has happened while releasing a new version

Describe alternatives you’ve considered

If i downgrade to the version 4.12.0 then i dont see this error anymore.

Additional context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rktechiecommented, May 12, 2022

CMD: ./gradlew operatorprovider:dependencyInsight --dependency kubernetes-model-common

Seems like fabric8 is itself downgrading it. You can see the dependency tree below:

io.fabric8:kubernetes-model-common:4.4.1 (selected by rule) variant “compile” [ org.gradle.status = release (not requested) org.gradle.usage = java-api org.gradle.category = library (not requested)

  Requested attributes not found in the selected variant:
     org.gradle.dependency.bundling = external
     org.gradle.jvm.version         = 11

]

io.fabric8:kubernetes-model-common:5.12.2 -> 4.4.1 ±-- io.fabric8:kubernetes-model-admissionregistration:5.12.2 | -– io.fabric8:kubernetes-client:5.12.2 | -– compileClasspath ±-- io.fabric8:kubernetes-model-apiextensions:5.12.2 | -– io.fabric8:kubernetes-client:5.12.2 () ±-- io.fabric8:kubernetes-model-apps:5.12.2 | -– io.fabric8:kubernetes-client:5.12.2 () ±-- io.fabric8:kubernetes-model-autoscaling:5.12.2 | -– io.fabric8:kubernetes-client:5.12.2 () ±-- io.fabric8:kubernetes-model-batch:5.12.2 | -– io.fabric8:kubernetes-client:5.12.2 () ±-- io.fabric8:kubernetes-model-certificates:5.12.2 | -– io.fabric8:kubernetes-client:5.12.2 () ±-- io.fabric8:kubernetes-model-coordination:5.12.2 | -– io.fabric8:kubernetes-client:5.12.2 () ±-- io.fabric8:kubernetes-model-core:5.12.2 | ±-- io.fabric8:kubernetes-client:5.12.2 () | ±-- io.fabric8:kubernetes-model-rbac:5.12.2 | | -– io.fabric8:kubernetes-client:5.12.2 () | ±-- io.fabric8:kubernetes-model-admissionregistration:5.12.2 () | ±-- io.fabric8:kubernetes-model-apps:5.12.2 () | ±-- io.fabric8:kubernetes-model-autoscaling:5.12.2 () | ±-- io.fabric8:kubernetes-model-apiextensions:5.12.2 () | ±-- io.fabric8:kubernetes-model-batch:5.12.2 () | ±-- io.fabric8:kubernetes-model-certificates:5.12.2 () | ±-- io.fabric8:kubernetes-model-coordination:5.12.2 () | ±-- io.fabric8:kubernetes-model-discovery:5.12.2 | | -– io.fabric8:kubernetes-client:5.12.2 () | ±-- io.fabric8:kubernetes-model-events:5.12.2 | | -– io.fabric8:kubernetes-client:5.12.2 () | ±-- io.fabric8:kubernetes-model-extensions:5.12.2 | | -– io.fabric8:kubernetes-client:5.12.2 () | ±-- io.fabric8:kubernetes-model-flowcontrol:5.12.2 | | -– io.fabric8:kubernetes-client:5.12.2 () | ±-- io.fabric8:kubernetes-model-networking:5.12.2 | | -– io.fabric8:kubernetes-client:5.12.2 () | ±-- io.fabric8:kubernetes-model-metrics:5.12.2 | | -– io.fabric8:kubernetes-client:5.12.2 () | ±-- io.fabric8:kubernetes-model-policy:5.12.2 | | -– io.fabric8:kubernetes-client:5.12.2 () | ±-- io.fabric8:kubernetes-model-scheduling:5.12.2 | | -– io.fabric8:kubernetes-client:5.12.2 () | ±-- io.fabric8:kubernetes-model-storageclass:5.12.2 | | -– io.fabric8:kubernetes-client:5.12.2 () | -– io.fabric8:kubernetes-model-node:5.12.2 | -– io.fabric8:kubernetes-client:5.12.2 () ±-- io.fabric8:kubernetes-model-discovery:5.12.2 () ±-- io.fabric8:kubernetes-model-events:5.12.2 () ±-- io.fabric8:kubernetes-model-extensions:5.12.2 () ±-- io.fabric8:kubernetes-model-flowcontrol:5.12.2 () ±-- io.fabric8:kubernetes-model-metrics:5.12.2 () ±-- io.fabric8:kubernetes-model-networking:5.12.2 () ±-- io.fabric8:kubernetes-model-node:5.12.2 () ±-- io.fabric8:kubernetes-model-policy:5.12.2 () ±-- io.fabric8:kubernetes-model-rbac:5.12.2 () ±-- io.fabric8:kubernetes-model-scheduling:5.12.2 () -– io.fabric8:kubernetes-model-storageclass:5.12.2 ()

(*) - dependencies omitted (listed previously)

0reactions
shawkinscommented, Dec 8, 2022

Should be the same issue as #4503 - some other unshown dependency is bring in a conflicting version of the fabric8 kubernetes client. That issue and the faq have been updated with how to handle this situation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.ClassNotFoundException: io.fabric8.kubernetes ...
Describe the bug I'm using io.fabric8:kubernetes-client:6.1.1 and am running a simple client creation code: final var kubernetesClient = new ...
Read more >
Fabric8 :: Kubernetes Model 4.9.2 API - Javadoc.io
Fabric8 :: Kubernetes Model 4.9.2 API. Packages. Package, Description. io.fabric8.kubernetes.api · io.fabric8.kubernetes.api.builder.
Read more >
Exception in thread "main" java.lang.NoClassDefFoundError
Spark-on-operator requires that the version of k8s is 1.13+, but in the openshift I use, the version of k8s is 1.11+, so replacing...
Read more >
fabric8io/kubernetes-client - Gitter
I tried running issue 2071 it is showing me this.OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will...
Read more >
io.fabric8 » kubernetes-client » 5.12.2 - Maven Repository
Category/License Group / Artifact Version Updates JSON Lib Apache 2.0 com.fasterxml.jackson.core » jackson‑core 2.13.1 2.14.1 Regexp Apache 2.0 com.github.mifmif » generex 1.0.2 ✓ HTTP Clients Apache...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found