You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Cache implementation doesn't find the getMetadata method although it is present:
2019-12-10T14:32:21.596Z ERROR [ReflectorRunnable] Failure in list-watch: java.lang.ReflectiveOperationException: java.lang.NoSuchMethodException: io.enmasse.iot.model.v1.IoTProject.getMetadata()
java.lang.RuntimeException: java.lang.ReflectiveOperationException: java.lang.NoSuchMethodException: io.enmasse.iot.model.v1.IoTProject.getMetadata()
at io.fabric8.kubernetes.client.informers.cache.Cache.metaNamespaceKeyFunc(Cache.java:365)
at io.fabric8.kubernetes.client.informers.cache.DeltaFIFO.keyOf(DeltaFIFO.java:381)
at io.fabric8.kubernetes.client.informers.cache.DeltaFIFO.replace(DeltaFIFO.java:165)
at io.fabric8.kubernetes.client.informers.cache.ReflectorRunnable.syncWith(ReflectorRunnable.java:145)
at io.fabric8.kubernetes.client.informers.cache.ReflectorRunnable.run(ReflectorRunnable.java:69)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ReflectiveOperationException: java.lang.NoSuchMethodException: io.enmasse.iot.model.v1.IoTProject.getMetadata()
at io.fabric8.kubernetes.client.utils.ReflectUtils.objectMetadata(ReflectUtils.java:31)
at io.fabric8.kubernetes.client.informers.cache.Cache.metaNamespaceKeyFunc(Cache.java:355)
... 10 more
Caused by: java.lang.NoSuchMethodException: io.enmasse.iot.model.v1.IoTProject.getMetadata()
at java.base/java.lang.Class.getDeclaredMethod(Class.java:2475)
at io.fabric8.kubernetes.client.utils.ReflectUtils.objectMetadata(ReflectUtils.java:28)
... 11 more
This is due to the fact that ReflectUtils uses getDeclaredMethod, which will only find methods which are directly declared on the class:
The
Cache
implementation doesn't find thegetMetadata
method although it is present:This is due to the fact that
ReflectUtils
usesgetDeclaredMethod
, which will only find methods which are directly declared on the class:kubernetes-client/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/ReflectUtils.java
Lines 28 to 29 in e2a8c9f
Instead of doing reflection, the code should check for
instanceof HasMetadata
and maybe then useClass#getMethod
.The text was updated successfully, but these errors were encountered: