fabric8io / kubernetes-model

JSON schema generator for OpenShift Origin API objects
36 stars 72 forks source link

3.0.0: ClassNotFoundException: io.fabric8.kubernetes.api.model.extensions.DaemonSet #324

Closed jkremser closed 6 years ago

jkremser commented 6 years ago

When using the latest version of this library, I got this (https://travis-ci.org/Jiri-Kremser/spark-operator/builds/399085700#L2093 ( https://github.com/Jiri-Kremser/spark-operator/pull/48 )):

NCDF exception Exception in thread "OkHttp Dispatcher" java.lang.NoClassDefFoundError: io/fabric8/kubernetes/api/model/extensions/DaemonSet at io.fabric8.kubernetes.client.handlers.DaemonSetHandler.getKind(DaemonSetHandler.java:38) at io.fabric8.kubernetes.client.Handlers.register(Handlers.java:43) at io.fabric8.kubernetes.client.Handlers.discoverHandlers(Handlers.java:66) at io.fabric8.kubernetes.client.Handlers.(Handlers.java:39) at io.fabric8.kubernetes.client.dsl.internal.NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.handlerOf(NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.java:364) at io.fabric8.kubernetes.client.dsl.internal.NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.acceptVisitors(NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.java:285) at io.fabric8.kubernetes.client.dsl.internal.NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.createOrReplace(NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.java:203) at io.fabric8.kubernetes.client.dsl.internal.NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.createOrReplace(NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableListImpl.java:65) at io.radanalytics.operator.cluster.ClusterOperator.onAdd(ClusterOperator.java:30) at io.radanalytics.operator.cluster.ClusterOperator.onAdd(ClusterOperator.java:15) at io.radanalytics.operator.common.AbstractOperator$1.eventReceived(AbstractOperator.java:108) at io.radanalytics.operator.common.AbstractOperator$1.eventReceived(AbstractOperator.java:95) at io.fabric8.kubernetes.client.utils.WatcherToggle.eventReceived(WatcherToggle.java:49) at io.fabric8.kubernetes.client.dsl.internal.WatchConnectionManager$2.onMessage(WatchConnectionManager.java:237) at okhttp3.internal.ws.RealWebSocket.onReadMessage(RealWebSocket.java:310) at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:222) at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:101) at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:265) at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:204) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassNotFoundException: io.fabric8.kubernetes.api.model.extensions.DaemonSet at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 24 more

I use k8s-client in version 3.2.0 and trying to use k8s-model in 3.0.0 (no openshift-client in the picture). Am I missing something obvious here, or is it just a bug?

oscerd commented 6 years ago

The DaemonSet stuff in 3.0.0 will be in io.fabric8.kubernetes.api.model.apps.DaemonSet;

The client still need to be updated according to the new model, so you'll need to wait.

piyush-garg commented 6 years ago

hey @Jiri-Kremser

DeamonSet has been moved to apps package from extension in openshift 3.9, we did the same thing in kubernetes-model 3.0.0 release. But client is expecting the same in extensions that is not any more avaialble. To fix this thing, I am already working on https://github.com/fabric8io/kubernetes-client/pull/1103 that will fix these errors in client. Hope this clears. Thanks

Closing the issue.

jkremser commented 6 years ago

cool, thanks for info. Perhaphs, it would be nice to release both mvn artifacts at the same time, because now it makes the k8s-model@3.0.0 unusable. I am not using the DeamonSets anywhere in my code, it just fails w/ this CNFE when initializing the client.

edit: i've just noticed this https://github.com/fabric8io/kubernetes-client/pull/1103#issuecomment-400350358 perhaps this can be handy for you: https://github.com/srcdeps/srcdeps-maven (it's also built by a Red Hatter :)) It can help if you want to test interactions between artifacts that haven't been released yet and you don't want to use SNAPSHOTs (because it's terrible for build reproducibility)

/cc @ppalaga

piyush-garg commented 6 years ago

Thanks a lot, @Jiri-Kremser that is a good thing I was not aware of. Thanks a lot. Will use that further.

jkremser commented 6 years ago

just letting you know that model@3.0.0 with client@4.0.0 works well :+1: