Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchMethodError when launch a spring batch worker using DeployerPartitionerHandler on KubernetesDeloyerTaskLaucher #926

Open
toandocoffee opened this issue Oct 5, 2023 · 3 comments

Comments

@toandocoffee
Copy link

toandocoffee commented Oct 5, 2023

I am getting this issue while trying to run the pod worker into kubernetes cluster using DeployerPartitionerHandler with Kubernetes Deployer

java.lang.NoSuchMethodError: 'io.fabric8.kubernetes.api.model.HTTPGetActionFluent io.fabric8.kubernetes.api.model.HTTPGetActionBuilder.withNewPort(java.lang.Integer)'
at org.springframework.cloud.deployer.spi.kubernetes.HttpProbeCreator.create(HttpProbeCreator.java:65) ~[spring-cloud-deployer-kubernetes-2.9.0.jar:na]

In the HTTPGetActionBuilder class there is a function withNewPort(Object port), even though the port 8989 has been populated but it thrown this exception

image

Please find more details of package version:

Spring boot: 3.1.4
Spring Cloud Task: 3.0.3
Spring Cloud Task Batch: 3.0.3
Spring Cloud Deployer: 2.9.0

This is how I configure the partition handler:

@Bean
public DeployerPartitionHandler partitionHandler() {
    Resource resource = new DockerResource("service-image");
    DeployerPartitionHandler partitionHandler = new DeployerPartitionHandler(taskLauncher, jobExplorer, resource, "ingestWorkerStep", taskRepository);
    List<String> commandLineArgs = new ArrayList<>(4);
    commandLineArgs.add("--spring.profiles.active=worker");
    commandLineArgs.add("--spring.cloud.task.initialize.enable=false");
    commandLineArgs.add("--spring.batch.initializer.enabled=false");
    commandLineArgs.add("--spring.datasource.initialize=false");
    commandLineArgs.add("--spring.datasource.initialize=false");
    partitionHandler.setCommandLineArgsProvider(new PassThroughCommandLineArgsProvider(commandLineArgs));
    partitionHandler.setEnvironmentVariablesProvider(new SimpleEnvironmentVariablesProvider(environment));
    partitionHandler.setMaxWorkers(3);
    partitionHandler.setApplicationName("partitionjob");
    return partitionHandler;
}
spring:
  cloud:
    deployer:
      kubernetes:
        namespace: default
        startup-http-probe-port: 8989
        liveness-http-probe-port: 8989
        readiness-http-probe-port: 8989
        host-network: true
        livenessProbePath: /actuator/health/liveness
        readinessProbePath: /actuator/health/readiness

Did I miss any configuration?

Thanks

@toandocoffee
Copy link
Author

toandocoffee commented Oct 5, 2023

There is another reported issue in this spring-cloud/spring-cloud-deployer#400. I am not sure if both are related

@corneil
Copy link

corneil commented Jan 4, 2024

Spring Cloud Deployer has not been tested with Spring Boot 3.x

@cppwfs
Copy link
Collaborator

cppwfs commented Jan 4, 2024

Hmmm.... I'm unable to reproduce, can you share a small example that exhibits the problem. It would be most helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants