fabric8io / kubernetes-client

Java client for Kubernetes & OpenShift
http://fabric8.io
Apache License 2.0
3.39k stars 1.46k forks source link

Exception in thread "main" java.lang.NoClassDefFoundError: io/fabric8/kubernetes/client/KubernetesClient #4503

Closed jiangjian0920 closed 1 year ago

jiangjian0920 commented 1 year ago

Describe the bug

After I change the user in the Spark image, the running program reports an error. What is the problem ++ id -u

Fabric8 Kubernetes Client version

6.1.1

Steps to reproduce

1.Change the user in the Spark image 2.Running Spark Program

Expected behavior

How to solve it

Runtime

other (please specify in additional context)

Kubernetes API Server version

other (please specify in additional context)

Environment

Linux

Fabric8 Kubernetes Client Logs

No response

Additional context

No response

szopal commented 1 year ago

I have the same problem - this error occurs in version 6.1.0, 6.1.1 - in 6.0.0 everything works fine.


2022-10-17 15:31:03.217 ERROR 25384 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.NoClassDefFoundError: io/fabric8/kubernetes/model/jackson/UnmatchedFieldTypeModule
    at io.fabric8.kubernetes.client.utils.Serialization.<clinit>(Serialization.java:55) ~[kubernetes-client-api-6.1.0.jar:na]
    at io.fabric8.kubernetes.client.internal.KubeConfigUtils.parseConfigFromString(KubeConfigUtils.java:46) ~[kubernetes-client-api-6.1.0.jar:na]
    at io.fabric8.kubernetes.client.Config.loadFromKubeconfig(Config.java:651) ~[kubernetes-client-api-6.1.0.jar:na]
    at io.fabric8.kubernetes.client.Config.tryKubeConfig(Config.java:614) ~[kubernetes-client-api-6.1.0.jar:na]
    at io.fabric8.kubernetes.client.Config.autoConfigure(Config.java:286) ~[kubernetes-client-api-6.1.0.jar:na]
    at io.fabric8.kubernetes.client.Config.<init>(Config.java:251) ~[kubernetes-client-api-6.1.0.jar:na]
    at io.fabric8.kubernetes.client.Config.<init>(Config.java:245) ~[kubernetes-client-api-6.1.0.jar:na]
    at io.fabric8.kubernetes.client.ConfigBuilder.<init>(ConfigBuilder.java:10) ~[kubernetes-client-api-6.1.0.jar:na]
    at io.fabric8.kubernetes.client.ConfigBuilder.<init>(ConfigBuilder.java:7) ~[kubernetes-client-api-6.1.0.jar:na]
    at io.fabric8.kubernetes.client.KubernetesClientBuilder.build(KubernetesClientBuilder.java:65) ~[kubernetes-client-api-6.1.0.jar:na]
    at com.test.spring.testapp.TestAppApplication.run(TestAppApplication.java:29) [classes/:na]
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:767) [spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:751) [spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:309) [spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) [spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) [spring-boot-2.6.1.jar:2.6.1]
    at com.test.spring.testapp.TestAppApplication.main(TestAppApplication.java:24) [classes/:na]
Caused by: java.lang.ClassNotFoundException: io.fabric8.kubernetes.model.jackson.UnmatchedFieldTypeModule
    at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[na:1.8.0_332]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_332]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) ~[na:1.8.0_332]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_332]
    ... 17 common frames omitted

Process finished with exit code 1
shawkins commented 1 year ago

@jiangjian0920 it's not immediately clear from what you posted what the effective classpath is for you spark application. It will need to see kubernetes-client and all of its transitive dependencies. The exception makes it seem like kuberentes-client-api is part of the classpath, but kubernetes-client is not.

@szopal that is a different problem. It should mean that you have a mismatch in your dependencies. The transitive kubernetes-model-common has UnmatchedFieldTypeModule. More than likely you are referencing an older version of that jar.

szopal commented 1 year ago

@shawkins only change what I did is upgrade kubernetes-client version

io.fabric8 kubernetes-client 6.1.1

It's simple SpringBoot app to test some things like this:

https://blog.marcnuri.com/fabric8-kubernetes-client-6-1

I did like above but unfortunately it's not working.

shawkins commented 1 year ago

@szopal please use some appropriate mechanism to check your dependency hierarchy, such as mvn depedendency:tree. That should highlight where there is a problem.

szopal commented 1 year ago
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------------< com.test.spring:test-app >----------------------
[INFO] Building test-app 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:3.3.0:tree (default-cli) @ test-app ---
[INFO] com.test.spring:test-app:jar:0.0.1-SNAPSHOT
[INFO] +- io.fabric8:kubernetes-client:jar:6.1.1:compile
[INFO] |  +- io.fabric8:kubernetes-client-api:jar:6.1.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-core:jar:5.10.2:compile
[INFO] |  |  |  +- io.fabric8:kubernetes-model-common:jar:5.10.2:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.4:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-gatewayapi:jar:6.1.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-rbac:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-admissionregistration:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-apps:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-autoscaling:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-apiextensions:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-batch:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-certificates:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-coordination:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-discovery:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-events:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-extensions:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-flowcontrol:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-networking:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-metrics:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-policy:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-scheduling:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-storageclass:jar:5.10.2:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-node:jar:5.10.2:compile
[INFO] |  |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.13.4:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.4:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.4:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.13.4:compile
[INFO] |  +- io.fabric8:kubernetes-httpclient-okhttp:jar:6.1.1:runtime
[INFO] |  |  +- com.squareup.okhttp3:okhttp:jar:4.9.3:runtime
[INFO] |  |  |  +- com.squareup.okio:okio:jar:2.8.0:runtime
[INFO] |  |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.6.21:runtime
[INFO] |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.6.21:runtime
[INFO] |  |  |     \- org.jetbrains:annotations:jar:13.0:runtime
[INFO] |  |  \- com.squareup.okhttp3:logging-interceptor:jar:4.9.3:runtime
[INFO] |  |     \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.6.21:runtime
[INFO] |  |        \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.6.21:runtime
[INFO] |  \- io.fabric8:zjsonpatch:jar:0.3.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.7.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.7.4:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:2.7.4:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.7.4:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.7.4:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.2.11:compile
[INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.2.11:compile
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.17.2:compile
[INFO] |  |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.17.2:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.36:compile
[INFO] |  |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.30:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.7.4:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.4:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.7.4:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.65:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.65:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.65:compile
[INFO] |  +- org.springframework:spring-web:jar:5.3.23:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:5.3.23:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.3.23:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.3.23:compile
[INFO] |     +- org.springframework:spring-context:jar:5.3.23:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.3.23:compile
[INFO] +- org.mybatis.spring.boot:mybatis-spring-boot-starter:jar:2.2.0:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.7.4:compile
[INFO] |  |  +- com.zaxxer:HikariCP:jar:4.0.3:compile
[INFO] |  |  \- org.springframework:spring-jdbc:jar:5.3.23:compile
[INFO] |  |     \- org.springframework:spring-tx:jar:5.3.23:compile
[INFO] |  +- org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:jar:2.2.0:compile
[INFO] |  +- org.mybatis:mybatis:jar:3.5.7:compile
[INFO] |  \- org.mybatis:mybatis-spring:jar:2.0.6:compile
[INFO] +- com.google.cloud:spring-cloud-gcp-starter-pubsub:jar:3.3.0:compile
[INFO] |  +- com.google.cloud:spring-cloud-gcp-pubsub:jar:3.3.0:compile
[INFO] |  |  \- com.google.cloud:google-cloud-pubsub:jar:1.117.0:compile
[INFO] |  |     +- io.grpc:grpc-api:jar:1.45.1:compile
[INFO] |  |     +- io.grpc:grpc-context:jar:1.45.1:compile
[INFO] |  |     +- io.grpc:grpc-stub:jar:1.45.1:compile
[INFO] |  |     +- io.grpc:grpc-protobuf:jar:1.45.1:compile
[INFO] |  |     +- io.grpc:grpc-protobuf-lite:jar:1.45.1:compile
[INFO] |  |     +- com.google.api:api-common:jar:2.1.5:compile
[INFO] |  |     +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  |     +- com.google.protobuf:protobuf-java:jar:3.19.4:compile
[INFO] |  |     +- com.google.api.grpc:proto-google-common-protos:jar:2.8.3:compile
[INFO] |  |     +- com.google.auth:google-auth-library-oauth2-http:jar:1.6.0:compile
[INFO] |  |     +- com.google.auth:google-auth-library-credentials:jar:1.6.0:compile
[INFO] |  |     +- com.google.http-client:google-http-client-gson:jar:1.41.7:compile
[INFO] |  |     +- com.google.code.gson:gson:jar:2.9.1:compile
[INFO] |  |     +- com.google.api.grpc:proto-google-cloud-pubsub-v1:jar:1.99.0:compile
[INFO] |  |     +- com.google.api.grpc:proto-google-iam-v1:jar:1.3.1:compile
[INFO] |  |     +- com.google.guava:guava:jar:31.1-jre:compile
[INFO] |  |     +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] |  |     +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] |  |     +- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  |     +- com.google.api:gax:jar:2.16.0:compile
[INFO] |  |     +- com.google.api:gax-grpc:jar:2.16.0:compile
[INFO] |  |     +- io.grpc:grpc-alts:jar:1.45.1:runtime
[INFO] |  |     +- io.grpc:grpc-grpclb:jar:1.45.1:runtime
[INFO] |  |     +- com.google.protobuf:protobuf-java-util:jar:3.19.4:compile
[INFO] |  |     +- org.conscrypt:conscrypt-openjdk-uber:jar:2.5.1:runtime
[INFO] |  |     +- io.grpc:grpc-auth:jar:1.45.1:runtime
[INFO] |  |     +- io.grpc:grpc-netty-shaded:jar:1.45.1:runtime
[INFO] |  |     +- io.grpc:grpc-googleapis:jar:1.45.1:runtime
[INFO] |  |     +- io.grpc:grpc-xds:jar:1.45.1:runtime
[INFO] |  |     +- io.grpc:grpc-services:jar:1.45.1:runtime
[INFO] |  |     +- com.google.re2j:re2j:jar:1.5:runtime
[INFO] |  |     +- org.bouncycastle:bcpkix-jdk15on:jar:1.67:compile
[INFO] |  |     +- org.bouncycastle:bcprov-jdk15on:jar:1.67:runtime
[INFO] |  |     +- io.opencensus:opencensus-proto:jar:0.2.0:runtime
[INFO] |  |     +- org.threeten:threetenbp:jar:1.6.0:compile
[INFO] |  |     +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  |     +- io.opencensus:opencensus-api:jar:0.31.0:compile
[INFO] |  |     +- io.grpc:grpc-core:jar:1.45.1:compile
[INFO] |  |     +- com.google.android:annotations:jar:4.1.1.4:runtime
[INFO] |  |     +- org.codehaus.mojo:animal-sniffer-annotations:jar:1.21:runtime
[INFO] |  |     +- io.perfmark:perfmark-api:jar:0.23.0:runtime
[INFO] |  |     +- com.google.errorprone:error_prone_annotations:jar:2.13.0:compile
[INFO] |  |     +- com.google.auto.value:auto-value-annotations:jar:1.9:compile
[INFO] |  |     +- com.google.http-client:google-http-client:jar:1.41.7:compile
[INFO] |  |     +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  |     \- io.opencensus:opencensus-contrib-http-util:jar:0.31.0:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.36:compile
[INFO] +- org.postgresql:postgresql:jar:42.3.7:compile
[INFO] |  \- org.checkerframework:checker-qual:jar:3.5.0:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.24:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.7.4:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.7.4:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.7.4:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.7.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.4.8:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:2.4.8:test
[INFO] |  |        \- org.ow2.asm:asm:jar:9.1:compile
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:test
[INFO] |  |  \- jakarta.activation:jakarta.activation-api:jar:1.2.2:test
[INFO] |  +- org.assertj:assertj-core:jar:3.22.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.8.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.8.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  +- org.junit.platform:junit-platform-commons:jar:1.8.2:test
[INFO] |  |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.8.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.8.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.8.2:test
[INFO] |  +- org.mockito:mockito-core:jar:4.5.1:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.12.17:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.12.17:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:4.5.1:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-core:jar:5.3.23:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.3.23:compile
[INFO] |  +- org.springframework:spring-test:jar:5.3.23:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.9.0:test
[INFO] +- org.springframework.cloud:spring-cloud-starter-vault-config:jar:3.1.0:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO] |  |  \- commons-codec:commons-codec:jar:1.15:compile
[INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.4.15:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter:jar:3.1.4:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-context:jar:3.1.4:compile
[INFO] |  |  |  \- org.springframework.security:spring-security-crypto:jar:5.7.3:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-commons:jar:3.1.4:compile
[INFO] |  |  \- org.springframework.security:spring-security-rsa:jar:1.0.11.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-vault-config:jar:3.1.1:compile
[INFO] |  \- org.springframework.vault:spring-vault-core:jar:2.3.2:compile
[INFO] +- com.google.cloud:spring-cloud-gcp-starter:jar:3.3.0:compile
[INFO] |  +- com.google.cloud:spring-cloud-gcp-core:jar:3.3.0:compile
[INFO] |  |  \- com.google.cloud:google-cloud-core:jar:2.6.0:compile
[INFO] |  \- com.google.cloud:spring-cloud-gcp-autoconfigure:jar:3.3.0:compile
[INFO] |     \- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] \- com.google.cloud:spring-cloud-gcp-starter-sql-postgresql:jar:3.3.0:compile
[INFO]    \- com.google.cloud.sql:postgres-socket-factory:jar:1.6.0:compile
[INFO]       \- com.google.cloud.sql:jdbc-socket-factory-core:jar:1.6.0:compile
[INFO]          +- com.github.jnr:jnr-unixsocket:jar:0.38.17:compile
[INFO]          |  +- com.github.jnr:jnr-ffi:jar:2.2.11:compile
[INFO]          |  |  +- com.github.jnr:jffi:jar:1.3.9:compile
[INFO]          |  |  +- com.github.jnr:jffi:jar:native:1.3.9:runtime
[INFO]          |  |  +- org.ow2.asm:asm-commons:jar:9.2:compile
[INFO]          |  |  +- com.github.jnr:jnr-a64asm:jar:1.0.0:compile
[INFO]          |  |  \- com.github.jnr:jnr-x86asm:jar:1.0.2:compile
[INFO]          |  +- com.github.jnr:jnr-constants:jar:0.10.3:compile
[INFO]          |  +- com.github.jnr:jnr-enxio:jar:0.32.13:compile
[INFO]          |  \- com.github.jnr:jnr-posix:jar:3.1.15:compile
[INFO]          +- org.ow2.asm:asm-util:jar:9.3:compile
[INFO]          |  +- org.ow2.asm:asm-tree:jar:9.3:compile
[INFO]          |  \- org.ow2.asm:asm-analysis:jar:9.3:compile
[INFO]          +- com.google.api-client:google-api-client:jar:1.34.0:compile
[INFO]          |  +- com.google.oauth-client:google-oauth-client:jar:1.33.2:compile
[INFO]          |  \- com.google.http-client:google-http-client-apache-v2:jar:1.41.7:compile
[INFO]          +- org.checkerframework:checker-compat-qual:jar:2.5.5:compile
[INFO]          \- com.google.apis:google-api-services-sqladmin:jar:v1beta4-rev20220323-1.32.1:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

I don't see any reason of this error.

jiangjian0920 commented 1 year ago

@shawkins OK, I'll try to replace the required dependency package

shawkins commented 1 year ago

I don't see any reason of this error.

@szopal see io.fabric8:kubernetes-model-core:jar:5.10.2:compile and all of the other dependencies still referencing 5.10.2. Please search your project source for that version.

jiangjian0920 commented 1 year ago

@shawkins I have replaced the dependent packages in the image, including(kubernetes-client-4.6.1.jar,kubernetes-model-4.6.1.jar,kubernetes-model-common-4.6.1.jar,okhttp-3.12.0.jar,okio-1.15.0.jar) Now the error is:22/10/18 15:46:26 INFO BlockManager: Initialized BlockManager: BlockManagerId(driver, spark-pi-1666107979581-driver-svc.spark.svc, 7079, None) Exception in thread "kubernetes-dispatcher-0" java.lang.NoSuchMethodError: io.fabric8.kubernetes.api.model.ObjectMeta.getDeletionTimestamp()Lio/fabric8/kubernetes/api/model/Time;

spark version:v2.4.0

shawkins commented 1 year ago

@jiangjian0920 that exception suggests you still have a mismatch with at least kubernetes-model-core

doxic012 commented 1 year ago

This exception occurs, when calling a KubernetesClientBuilder like this:

NamespacedKubernetesClient namespacedClient = (NamespacedKubernetesClient) new KubernetesClientBuilder().build();

When trying to parse a config file using Serialization.yamlMapper() inside the package io.fabric8.kubernetes.client.Config:653

io.fabric8.kubernetes.api.model.Config kubeConfig = KubeConfigUtils.parseConfigFromString(kubeconfigContents);

the mapper uses the io.fabric8.kubernetes.model.jackson.UnmatchedFieldTypeModule class which is not provided using only the kubernetes-client dependency.

This is (part of) our pom.xml:

<properties>
        <kubernetes-client.version>6.2.0</kubernetes-client.version>
</properties>

<dependencies>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-client</artifactId>
        </dependency>
<dependencies>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-client</artifactId>
            <version>${kubernetes-client.version}</version>
        </dependency>

        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-model</artifactId>
            <version>${kubernetes-client.version}</version>
        </dependency>
    </dependencies>
</dependencyManagement>
doxic012 commented 1 year ago

Can be solved by explicitly adding a dependency in dependencyManagement to kubernetes-model-common 6.2.0 in the pom.xml:

<dependencyManagement>
  <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-model-common</artifactId>
      <version>6.2.0</version>
  </dependency>
</dependencyManagement>

Maybe the model-generator is not running properly or the project references previous versions for model, etc? When I remove all dependencyManagement values for kubernetes-model and kubernetes-model-common (only leaving kubernetes-client 6.2.0), the effective pom contains all dependencies for 5.10.2, except for kubernetes-client:

<dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model-common</artifactId>
        <version>5.10.2</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>model-annotator</artifactId>
        <version>5.10.2</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model-core</artifactId>
        <version>5.10.2</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model-rbac</artifactId>
        <version>5.10.2</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model-admissionregistration</artifactId>
        <version>5.10.2</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model-apps</artifactId>
        <version>5.10.2</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model-autoscaling</artifactId>
        <version>5.10.2</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model-apiextensions</artifactId>
        <version>5.10.2</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model-batch</artifactId>
        <version>5.10.2</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model-certificates</artifactId>
        <version>5.10.2</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model-coordination</artifactId>
        <version>5.10.2</version>
      </dependency>
...
shawkins commented 1 year ago

@doxic012 like the others you have a mismatch in your transitive dependencies. The minimum pom dependencies are:

<dependencies>
      <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-client-api</artifactId>
            <version>6.2.0</version>
      </dependency>
      <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-client</artifactId>
            <scope>runtime</scope>
            <version>6.2.0</version>
      </dependency>
<dependencies>

Everything else will come in transitively from those.

Please use dependency:tree as @szopal did above and identify where you are referencing other versions.

doxic012 commented 1 year ago

@doxic012 like the others you have a mismatch in your transitive dependencies. The minimum pom dependencies are:

<dependencies>
      <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-client-api</artifactId>
            <version>6.2.0</version>
      </dependency>
      <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>kubernetes-client</artifactId>
            <scope>runtime</scope>
            <version>6.2.0</version>
      </dependency>
<dependencies>

Everything else will come in transitively from those.

Please use dependency:tree as @szopal did above and identify where you are referencing other versions.

Yes that seems to solve the issue. Maybe put the minimum dependencies in the readme for kubernetes-client? I was searching for the imports on the start page, since we are migrating from version 4.x to 6.0.0 and we only imported kubernetes-client from maven which was working fine until upgrading to 6.2.0

edit: nvm it does not solve the issue, versions 5.10.2 are still imported. This is my dependency:tree:

[INFO] +- io.fabric8:kubernetes-client-api:jar:6.2.0:compile [INFO] | +- io.fabric8:kubernetes-model-core:jar:5.10.2:compile [INFO] | | +- io.fabric8:kubernetes-model-common:jar:5.10.2:compile [INFO] | | - com.fasterxml.jackson.core:jackson-annotations:jar:2.13.4:compile [INFO] | +- io.fabric8:kubernetes-model-gatewayapi:jar:6.2.0:compile [INFO] | +- io.fabric8:kubernetes-model-rbac:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-admissionregistration:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-apps:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-autoscaling:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-apiextensions:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-batch:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-certificates:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-coordination:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-discovery:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-events:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-extensions:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-flowcontrol:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-networking:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-metrics:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-policy:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-scheduling:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-storageclass:jar:5.10.2:compile [INFO] | +- io.fabric8:kubernetes-model-node:jar:5.10.2:compile ...

@shawkins Any other advice beside this? I also cleared my m2 repo as well to ensure that the dependencies weren't corrupt

shawkins commented 1 year ago

Maybe put the minimum dependencies in the readme for kubernetes-client?

There's a section in the FAQ https://github.com/fabric8io/kubernetes-client/blob/master/doc/FAQ.md#what-artifacts-should-my-project-depend-on - can you suggest a change to the README or other docs?

since we are migrating from version 4.x to 6.0.0 and we only imported kubernetes-client from maven which was working fine until upgrading to 6.2.0

That will still work - but only if you stick to just a single version. By mixing in the 5.10.2 dependencies there will be issues some classes and packages have been refactored.

Please search your project for where 5.10.2 is being referenced.

doxic012 commented 1 year ago

No idea where it's coming from, we do not have any references to kubernetes-client/kubernetes-client-api besides this project (and no dependency-management that indicates a different version).

Whats also interesting in the dependency tree is the [INFO] | +- io.fabric8:kubernetes-model-gatewayapi:jar:6.2.0:compile

which seems to be the only correct reference to 6.2.0

There's a section in the FAQ https://github.com/fabric8io/kubernetes-client/blob/master/doc/FAQ.md#what-artifacts-should-my-project-depend-on - can you suggest a change to the README or other docs?

Maybe add the dependencies you mentioned above just below bullet point 2., that would be sufficient for most people I guess

shawkins commented 1 year ago

No idea where it's coming from, we do not have any references to kubernetes-client/kubernetes-client-api besides this project (and no dependency-management that indicates a different version).

Is your project importing kubernetes-client-project as a bom? Have you searched for any reference to a 5.10.2 version?

which seems to be the only correct reference to 6.2.0

Probably because that module did not exist in 5.10.2.

doxic012 commented 1 year ago

Apparently its coming from spring-cloud-dependencies, there is a property with the version. Got some headaches for this to find the dependency, as it is not obvious to find from mvn dependency:tree

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-dependencies</artifactId>
    <version>2021.0.3</version>
</dependency>

`

5.10.2 ` There is also a reference to kubernetes-client-bom inside. Overriding the version in the pom still does not seem to have an effect to the result. Seems that I have to get rid of the whole spring-cloud-dependencies package
shawkins commented 1 year ago

@doxic012 ah, good catch.

Can you try overriding with your own bom:

     <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-client-bom</artifactId>
                <version>${fabric8.client.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

The client is largely compatible between 5.10 and 6.2, however if spring is relying on anything that is no longer there, then it seems like you'll be forced to stay at 5.10.2 until spring updates their dependency.

doxic012 commented 1 year ago

@doxic012 ah, good catch.

Can you try overriding with your own bom:

     <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-client-bom</artifactId>
                <version>${fabric8.client.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

The client is largely compatible between 5.10 and 6.2, however if spring is relying on anything that is no longer there, then it seems like you'll be forced to stay at 5.10.2 until spring updates their dependency.

Thanks, that did actually work. Forgot to write that spring-cloud-dependencies imports the bom with import and pom, which does not allow transitive property version overrides from the project pom.

szopal commented 1 year ago

I upgraded io.fabric8.kubernetes to 6.3.1 from 6.0.0 - I don't want to create a new issue, I do everything like you wrote above - add dependency with bom:

      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-client-bom</artifactId>
        <version>${kubenetes-client.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>

Generate dependency tree:

[INFO] --- maven-dependency-plugin:3.3.0:tree (default-cli) @ xxxx-k8s-batch-management-boot ---
[INFO] pl.xxxx:xxxx-k8s-batch-management-boot:jar:0.0.1-SNAPSHOT
[INFO] +- pl.xxxx:xxxxx:jar:0.0.1-SNAPSHOT:compile
[INFO] |  \- com.auth0:java-jwt:jar:4.0.0:compile
[INFO] +- org.springframework.cloud:spring-cloud-dataflow-rest-client:jar:0.0.1-SNAPSHOT:compile
[INFO] |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.4:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.13.4:compile
[INFO] |  +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.4:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.4.2:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.4:compile
[INFO] |  +- joda-time:joda-time:jar:2.10.6:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-skipper:jar:2.8.4:compile
[INFO] |  |  +- org.springframework.hateoas:spring-hateoas:jar:1.5.2:compile
[INFO] |  |  |  \- org.springframework.plugin:spring-plugin-core:jar:2.0.0.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-configuration-metadata:jar:2.7.7:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-validation:jar:2.7.7:compile
[INFO] |  |  |  \- org.hibernate.validator:hibernate-validator:jar:6.2.5.Final:compile
[INFO] |  |  |     \- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] |  |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] |  |  +- org.springframework.data:spring-data-keyvalue:jar:2.7.6:compile
[INFO] |  |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.13.4:compile
[INFO] |  |  +- org.zeroturnaround:zt-zip:jar:1.13:compile
[INFO] |  |  \- org.springframework.cloud:spring-cloud-deployer-spi:jar:2.7.4:compile
[INFO] |  |     \- io.projectreactor:reactor-core:jar:3.4.26:compile
[INFO] |  |        \- org.reactivestreams:reactive-streams:jar:1.0.4:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-dataflow-rest-resource:jar:2.9.4:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-dataflow-core:jar:2.9.4:compile
[INFO] |  |  |  +- org.springframework.cloud:spring-cloud-dataflow-core-dsl:jar:2.9.4:compile
[INFO] |  |  |  +- org.apache.commons:commons-text:jar:1.9:compile
[INFO] |  |  |  \- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |  +- org.springframework.batch:spring-batch-core:jar:4.3.7:compile
[INFO] |  |  |  +- javax.batch:javax.batch-api:jar:1.0:compile
[INFO] |  |  |  \- org.springframework.batch:spring-batch-infrastructure:jar:4.3.7:compile
[INFO] |  |  |     \- org.springframework.retry:spring-retry:jar:1.3.4:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-task-core:jar:2.4.5:compile
[INFO] |  |  |  +- org.springframework.cloud:spring-cloud-deployer-autoconfigure:jar:2.7.4:compile
[INFO] |  |  |  \- org.springframework.cloud:spring-cloud-deployer-resource-support:jar:2.7.4:compile
[INFO] |  |  \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.14.1:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-common-security-config-core:jar:1.7.4:compile
[INFO] |  |  \- org.springframework.security:spring-security-oauth2-client:jar:5.7.3:compile
[INFO] |  |     +- org.springframework.security:spring-security-core:jar:5.7.6:compile
[INFO] |  |     +- org.springframework.security:spring-security-oauth2-core:jar:5.7.6:compile
[INFO] |  |     +- org.springframework.security:spring-security-web:jar:5.7.6:compile
[INFO] |  |     \- com.nimbusds:oauth2-oidc-sdk:jar:9.35:compile
[INFO] |  |        +- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] |  |        +- com.nimbusds:content-type:jar:2.2:compile
[INFO] |  |        +- com.nimbusds:lang-tag:jar:1.6:compile
[INFO] |  |        \- com.nimbusds:nimbus-jose-jwt:jar:9.22:compile
[INFO] |  \- com.vdurmont:semver4j:jar:2.2.0:compile
[INFO] +- pl.xxxxx.xxxxx:jar:0.0.1-SNAPSHOT:compile
[INFO] |  +- commons-validator:commons-validator:jar:1.7:compile
[INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.9.4:compile
[INFO] |  |  +- commons-digester:commons-digester:jar:2.1:compile
[INFO] |  |  +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  |  \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] |  +- com.google.guava:guava:jar:31.1-jre:compile
[INFO] |  |  +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] |  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] |  |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  |  +- com.google.errorprone:error_prone_annotations:jar:2.11.0:compile
[INFO] |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.14.1:compile
[INFO] |  |  +- org.codehaus.woodstox:stax2-api:jar:4.2.1:compile
[INFO] |  |  \- com.fasterxml.woodstox:woodstox-core:jar:6.4.0:compile
[INFO] |  \- org.springframework.boot:spring-boot-starter-aop:jar:2.7.7:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.3.24:compile
[INFO] |     \- org.aspectj:aspectjweaver:jar:1.9.7:compile
[INFO] +- pl.xxxxx.xxxxx:jar:0.0.1-SNAPSHOT:compile
[INFO] |  +- com.google.cloud:google-cloud-storage:jar:2.16.0:compile
[INFO] |  |  +- com.google.http-client:google-http-client:jar:1.42.3:compile
[INFO] |  |  +- io.opencensus:opencensus-contrib-http-util:jar:0.31.1:compile
[INFO] |  |  +- com.google.http-client:google-http-client-jackson2:jar:1.42.3:compile
[INFO] |  |  +- com.google.http-client:google-http-client-gson:jar:1.42.3:compile
[INFO] |  |  +- com.google.api-client:google-api-client:jar:2.1.1:compile
[INFO] |  |  +- commons-codec:commons-codec:jar:1.15:compile
[INFO] |  |  +- com.google.oauth-client:google-oauth-client:jar:1.34.1:compile
[INFO] |  |  +- com.google.http-client:google-http-client-apache-v2:jar:1.42.3:compile
[INFO] |  |  +- com.google.apis:google-api-services-storage:jar:v1-rev20220705-2.0.0:compile
[INFO] |  |  +- com.google.code.gson:gson:jar:2.9.1:compile
[INFO] |  |  +- com.google.cloud:google-cloud-core:jar:2.9.0:compile
[INFO] |  |  +- com.google.auto.value:auto-value-annotations:jar:1.10.1:compile
[INFO] |  |  +- com.google.cloud:google-cloud-core-http:jar:2.9.0:compile
[INFO] |  |  +- com.google.http-client:google-http-client-appengine:jar:1.42.3:compile
[INFO] |  |  +- com.google.api:gax-httpjson:jar:0.105.1:compile
[INFO] |  |  +- com.google.cloud:google-cloud-core-grpc:jar:2.9.0:compile
[INFO] |  |  +- io.grpc:grpc-core:jar:1.51.0:compile
[INFO] |  |  +- com.google.android:annotations:jar:4.1.1.4:runtime
[INFO] |  |  +- org.codehaus.mojo:animal-sniffer-annotations:jar:1.22:runtime
[INFO] |  |  +- com.google.api:gax:jar:2.20.1:compile
[INFO] |  |  +- com.google.api:gax-grpc:jar:2.20.1:compile
[INFO] |  |  +- io.grpc:grpc-alts:jar:1.51.0:compile
[INFO] |  |  +- io.grpc:grpc-grpclb:jar:1.51.0:compile
[INFO] |  |  +- org.conscrypt:conscrypt-openjdk-uber:jar:2.5.2:compile
[INFO] |  |  +- io.grpc:grpc-protobuf:jar:1.51.0:compile
[INFO] |  |  +- com.google.auth:google-auth-library-credentials:jar:1.13.0:compile
[INFO] |  |  +- com.google.auth:google-auth-library-oauth2-http:jar:1.13.0:compile
[INFO] |  |  +- com.google.api:api-common:jar:2.2.2:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  |  +- io.opencensus:opencensus-api:jar:0.31.1:compile
[INFO] |  |  +- io.grpc:grpc-context:jar:1.51.0:compile
[INFO] |  |  +- com.google.api.grpc:proto-google-iam-v1:jar:1.6.22:compile
[INFO] |  |  +- com.google.protobuf:protobuf-java:jar:3.21.10:compile
[INFO] |  |  +- com.google.protobuf:protobuf-java-util:jar:3.21.10:compile
[INFO] |  |  +- com.google.api.grpc:proto-google-common-protos:jar:2.11.0:compile
[INFO] |  |  +- org.threeten:threetenbp:jar:1.6.4:compile
[INFO] |  |  +- com.google.api.grpc:proto-google-cloud-storage-v2:jar:2.16.0-alpha:compile
[INFO] |  |  +- com.google.api.grpc:grpc-google-cloud-storage-v2:jar:2.16.0-alpha:compile
[INFO] |  |  +- com.google.api.grpc:gapic-google-cloud-storage-v2:jar:2.16.0-alpha:compile
[INFO] |  |  +- io.grpc:grpc-api:jar:1.51.0:compile
[INFO] |  |  +- io.grpc:grpc-netty-shaded:jar:1.51.0:compile
[INFO] |  |  +- io.perfmark:perfmark-api:jar:0.26.0:runtime
[INFO] |  |  +- io.grpc:grpc-auth:jar:1.51.0:compile
[INFO] |  |  +- io.grpc:grpc-stub:jar:1.51.0:compile
[INFO] |  |  +- io.grpc:grpc-googleapis:jar:1.51.0:runtime
[INFO] |  |  +- io.grpc:grpc-xds:jar:1.51.0:runtime
[INFO] |  |  +- io.opencensus:opencensus-proto:jar:0.2.0:runtime
[INFO] |  |  +- io.grpc:grpc-services:jar:1.51.0:runtime
[INFO] |  |  +- com.google.re2j:re2j:jar:1.6:runtime
[INFO] |  |  +- com.google.api.grpc:grpc-google-iam-v1:jar:1.6.22:compile
[INFO] |  |  \- io.grpc:grpc-protobuf-lite:jar:1.51.0:compile
[INFO] |  +- commons-io:commons-io:jar:2.6:compile
[INFO] |  \- com.google.cloud:google-cloud-nio:jar:0.126.0:compile
[INFO] |     \- javax.inject:javax.inject:jar:1:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-vault-config:jar:3.1.1:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.14:compile
[INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.4.16:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter:jar:3.1.5:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-context:jar:3.1.5:compile
[INFO] |  |  |  \- org.springframework.security:spring-security-crypto:jar:5.7.6:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-commons:jar:3.1.5:compile
[INFO] |  |  \- org.springframework.security:spring-security-rsa:jar:1.0.11.RELEASE:compile
[INFO] |  |     \- org.bouncycastle:bcpkix-jdk15on:jar:1.69:compile
[INFO] |  |        +- org.bouncycastle:bcprov-jdk15on:jar:1.69:compile
[INFO] |  |        \- org.bouncycastle:bcutil-jdk15on:jar:1.69:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-vault-config:jar:3.1.1:compile
[INFO] |  \- org.springframework.vault:spring-vault-core:jar:2.3.2:compile
[INFO] |     \- org.springframework:spring-context:jar:5.3.24:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.7.7:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.7.7:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:2.7.7:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.7.7:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.7.7:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.2.11:compile
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.17.2:compile
[INFO] |  |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.17.2:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.36:compile
[INFO] |  |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.30:compile
[INFO] |  +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.7.7:compile
[INFO] |  |  \- org.springframework.boot:spring-boot-actuator:jar:2.7.7:compile
[INFO] |  \- io.micrometer:micrometer-core:jar:1.9.6:compile
[INFO] |     +- org.hdrhistogram:HdrHistogram:jar:2.1.12:compile
[INFO] |     \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.7.7:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.7.7:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.7.7:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.70:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.70:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.70:compile
[INFO] |  +- org.springframework:spring-web:jar:5.3.24:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:5.3.24:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.3.24:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.3.24:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.24:compile
[INFO] +- org.postgresql:postgresql:jar:42.5.1:compile
[INFO] |  \- org.checkerframework:checker-qual:jar:3.5.0:compile
[INFO] +- com.google.cloud:spring-cloud-gcp-starter-sql-postgresql:jar:3.4.1:compile
[INFO] |  +- com.google.cloud:spring-cloud-gcp-starter:jar:3.4.1:compile
[INFO] |  |  +- com.google.cloud:spring-cloud-gcp-core:jar:3.4.1:compile
[INFO] |  |  \- com.google.cloud:spring-cloud-gcp-autoconfigure:jar:3.4.1:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.7.7:compile
[INFO] |  |  +- com.zaxxer:HikariCP:jar:4.0.3:compile
[INFO] |  |  \- org.springframework:spring-jdbc:jar:5.3.24:compile
[INFO] |  +- com.google.cloud.sql:postgres-socket-factory:jar:1.8.0:compile
[INFO] |  |  \- com.google.cloud.sql:jdbc-socket-factory-core:jar:1.8.0:compile
[INFO] |  |     +- com.github.jnr:jnr-unixsocket:jar:0.38.19:compile
[INFO] |  |     |  +- com.github.jnr:jnr-ffi:jar:2.2.13:compile
[INFO] |  |     |  |  +- com.github.jnr:jffi:jar:1.3.10:compile
[INFO] |  |     |  |  +- com.github.jnr:jffi:jar:native:1.3.10:runtime
[INFO] |  |     |  |  +- org.ow2.asm:asm-commons:jar:9.2:compile
[INFO] |  |     |  |  +- com.github.jnr:jnr-a64asm:jar:1.0.0:compile
[INFO] |  |     |  |  \- com.github.jnr:jnr-x86asm:jar:1.0.2:compile
[INFO] |  |     |  +- com.github.jnr:jnr-constants:jar:0.10.4:compile
[INFO] |  |     |  +- com.github.jnr:jnr-enxio:jar:0.32.14:compile
[INFO] |  |     |  \- com.github.jnr:jnr-posix:jar:3.1.16:compile
[INFO] |  |     +- org.ow2.asm:asm-util:jar:9.4:compile
[INFO] |  |     |  +- org.ow2.asm:asm:jar:9.4:compile
[INFO] |  |     |  +- org.ow2.asm:asm-tree:jar:9.4:compile
[INFO] |  |     |  \- org.ow2.asm:asm-analysis:jar:9.4:compile
[INFO] |  |     +- org.checkerframework:checker-compat-qual:jar:2.5.5:compile
[INFO] |  |     \- com.google.apis:google-api-services-sqladmin:jar:v1beta4-rev20221113-2.0.0:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.36:compile
[INFO] +- com.google.cloud:spring-cloud-gcp-starter-logging:jar:3.4.1:compile
[INFO] |  \- com.google.cloud:spring-cloud-gcp-logging:jar:3.4.1:compile
[INFO] |     +- ch.qos.logback.contrib:logback-json-classic:jar:0.1.5:compile
[INFO] |     |  \- ch.qos.logback.contrib:logback-json-core:jar:0.1.5:compile
[INFO] |     \- com.google.cloud:google-cloud-logging-logback:jar:0.129.6-alpha:compile
[INFO] |        +- ch.qos.logback:logback-core:jar:1.2.11:compile
[INFO] |        +- com.google.cloud:google-cloud-logging:jar:3.13.6:compile
[INFO] |        +- com.google.api.grpc:proto-google-cloud-logging-v2:jar:0.102.6:compile
[INFO] |        \- org.jspecify:jspecify:jar:0.2.0:compile
[INFO] +- io.fabric8:kubernetes-client:jar:6.3.1:compile
[INFO] |  +- io.fabric8:kubernetes-client-api:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-core:jar:6.3.1:compile
[INFO] |  |  |  \- io.fabric8:kubernetes-model-common:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-gatewayapi:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-rbac:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-admissionregistration:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-apps:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-autoscaling:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-apiextensions:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-batch:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-certificates:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-coordination:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-discovery:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-events:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-extensions:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-flowcontrol:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-networking:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-metrics:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-policy:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-scheduling:jar:6.3.1:compile
[INFO] |  |  +- io.fabric8:kubernetes-model-storageclass:jar:6.3.1:compile
[INFO] |  |  \- io.fabric8:kubernetes-model-node:jar:6.3.1:compile
[INFO] |  +- io.fabric8:kubernetes-httpclient-okhttp:jar:6.3.1:runtime
[INFO] |  |  +- com.squareup.okhttp3:okhttp:jar:4.9.3:runtime
[INFO] |  |  |  +- com.squareup.okio:okio:jar:2.8.0:runtime
[INFO] |  |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.6.21:runtime
[INFO] |  |  |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.6.21:runtime
[INFO] |  |  |     \- org.jetbrains:annotations:jar:13.0:runtime
[INFO] |  |  \- com.squareup.okhttp3:logging-interceptor:jar:4.9.3:runtime
[INFO] |  |     \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.6.21:runtime
[INFO] |  |        \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.6.21:runtime
[INFO] |  \- io.fabric8:zjsonpatch:jar:0.3.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.7.7:compile
[INFO] |  +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] |  +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:5.6.14.Final:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.4.3.Final:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.12.20:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  +- org.jboss:jandex:jar:2.4.2.Final:compile
[INFO] |  |  +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.2.Final:compile
[INFO] |  |  \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.7:compile
[INFO] |  |     +- org.glassfish.jaxb:txw2:jar:2.3.7:compile
[INFO] |  |     +- com.sun.istack:istack-commons-runtime:jar:3.0.12:compile
[INFO] |  |     \- com.sun.activation:jakarta.activation:jar:1.2.2:runtime
[INFO] |  +- org.springframework.data:spring-data-jpa:jar:2.7.6:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons:jar:2.7.6:compile
[INFO] |  |  +- org.springframework:spring-orm:jar:5.3.24:compile
[INFO] |  |  \- org.springframework:spring-tx:jar:5.3.24:compile
[INFO] |  \- org.springframework:spring-aspects:jar:5.3.24:compile
[INFO] +- org.json:json:jar:20220924:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.7.7:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.7.7:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.7.7:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.7.0:compile
[INFO] |  |  \- net.minidev:json-smart:jar:2.4.8:compile
[INFO] |  |     \- net.minidev:accessors-smart:jar:2.4.8:compile
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] |  |  \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] |  +- org.assertj:assertj-core:jar:3.22.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.8.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.8.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  +- org.junit.platform:junit-platform-commons:jar:1.8.2:test
[INFO] |  |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.8.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.8.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.8.2:test
[INFO] |  +- org.mockito:mockito-core:jar:4.5.1:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.12.20:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:4.5.1:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:runtime
[INFO] |  +- org.springframework:spring-core:jar:5.3.24:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.3.24:compile
[INFO] |  +- org.springframework:spring-test:jar:5.3.24:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.9.0:test
[INFO] \- junit:junit:jar:4.13.2:test
[INFO]    \- org.hamcrest:hamcrest-core:jar:2.2:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.816 s
[INFO] Finished at: 2023-01-03T08:50:06+01:00
[INFO] ------------------------------------------------------------------------

But I've still got error: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: io/fabric8/kubernetes/model/jackson/UnmatchedFieldTypeModule] with root cause java.lang.ClassNotFoundException: io.fabric8.kubernetes.model.jackson.UnmatchedFieldTypeModule at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589) at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at io.fabric8.kubernetes.client.utils.Serialization.<clinit>(Serialization.java:55) at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.<clinit>(OperationSupport.java:72) at io.fabric8.kubernetes.client.impl.ResourceHandlerImpl.operation(ResourceHandlerImpl.java:81) at io.fabric8.kubernetes.client.impl.Handlers.getOperation(Handlers.java:145) at io.fabric8.kubernetes.client.impl.BaseClient.resources(BaseClient.java:279) at io.fabric8.kubernetes.client.extension.ClientAdapter.resources(ClientAdapter.java:129) at io.fabric8.kubernetes.client.Client.resources(Client.java:162) at io.fabric8.kubernetes.client.impl.V1BatchAPIGroupClient.cronjobs(V1BatchAPIGroupClient.java:38) at pl.xxxx.acp.k8s.batch.management.service.SchedulingService.editImageProces(SchedulingService.java:170) at pl.xxxx.xxxx.k8s.batch.management.controller.ProcessController.edit(ProcessController.java:37) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:920) at javax.servlet.http.HttpServlet.service(HttpServlet.java:699) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at pl.xxxx.xxxx.security.filter.AbstractAuthFilter.doFilter(AbstractAuthFilter.java:63) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at pl.xxxx.xxxxx.security.filter.AbstractCorsFilter.doFilter(AbstractCorsFilter.java:41) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:769) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:829)

I used

    <spring-cloud-gcp-dependencies.version>3.4.1</spring-cloud-gcp-dependencies.version>
    <spring-cloud.version>2021.0.5</spring-cloud.version>

And I would like to use version higher than 6.0.0 for io.fabrci8 :(

shawkins commented 1 year ago

@szopal the dependency tree is correct, but your runtime seems to still be affected. Can you examine the spring runtime jar to see what dependencies are actually included?