Zeebe Client initialization getting failed during springboot application startup

I am receiving the following error while starting up my springboot application with camunda.8 dependency. Can someone let me know where the issue is?


APPLICATION FAILED TO START


Description:

Parameter 0 of method zeebeClientObjectFactory in io.camunda.zeebe.spring.client.ZeebeClientSpringConfiguration required a bean of type ‘io.camunda.zeebe.client.ZeebeClientBuilder’ that could not be found.

Action:

Consider defining a bean of type ‘io.camunda.zeebe.client.ZeebeClientBuilder’ in your configuration.


Full trace

2023-07-01T16:35:34.649+05:30 WARN 24660 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘zeebeClientLifecycle’ defined in io.camunda.zeebe.spring.client.ZeebeClientSpringConfiguration: Unsatisfied dependency expressed through method ‘zeebeClientLifecycle’ parameter 0: Error creating bean with name ‘zeebeClientObjectFactory’ defined in io.camunda.zeebe.spring.client.ZeebeClientSpringConfiguration: Unsatisfied dependency expressed through method ‘zeebeClientObjectFactory’ parameter 0: No qualifying bean of type ‘io.camunda.zeebe.client.ZeebeClientBuilder’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2023-07-01T16:35:34.655+05:30 INFO 24660 — [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2023-07-01T16:35:34.696+05:30 INFO 24660 — [ main] .s.b.a.l.ConditionEvaluationReportLogger :

Hello @Supriyo ,

which depedency are you using for the spring boot zeebe client?

Jonathan

1 Like

Hi Jonathan,
Thanks for your response. I am using below dependency.


<properties>
	<java.version>20</java.version>
	<zeebe.version>8.0.8</zeebe.version>
</properties>
<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-actuator</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-jersey</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>

	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<optional>true</optional>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
	    <groupId>org.springframework.boot</groupId>
	    <artifactId>spring-boot-starter-web</artifactId>
	</dependency>
	<dependency>
		<groupId>io.camunda</groupId>
		<artifactId>zeebe-client-java</artifactId>
		<version>${zeebe.version}</version>
	</dependency>
	<dependency>
	    <groupId>io.camunda</groupId>
	    <artifactId>spring-zeebe-starter</artifactId>
	    <version>${zeebe.version}</version>
	</dependency>		
</dependencies>

Hello @Supriyo ,

could you please try to leave out the zeebe-client-java? It should be included transitive by the spring-zeebe-starter.

Do you use any configuration beside the @EnableZeebeClient annotation?

Jonathan

Hi Jonathan,

This is my spring application java file.


package com.example.demo;

import io.camunda.zeebe.spring.client.EnableZeebeClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableZeebeClient
@RestController
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
System.out.println(“SpringApplication Running”);
}

}

I have removed the zeebe-client-java from dependency, but I still see the same error.

Thanks in Advance.
Supriyo

Hello @Supriyo ,

have you tried updating to Spring Zeebe 8.0.11?

Jonathan

1 Like

Hi @jonathan.lukas

Just now I have tried with <zeebe.version>8.0.11</zeebe.version>
but same error reported. Please find attached error below.


2023-07-03T14:18:06.325+05:30 WARN 26076 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘zeebeClientLifecycle’ defined in io.camunda.zeebe.spring.client.ZeebeClientSpringConfiguration: Unsatisfied dependency expressed through method ‘zeebeClientLifecycle’ parameter 0: Error creating bean with name ‘zeebeClientObjectFactory’ defined in io.camunda.zeebe.spring.client.ZeebeClientSpringConfiguration: Unsatisfied dependency expressed through method ‘zeebeClientObjectFactory’ parameter 0: No qualifying bean of type ‘io.camunda.zeebe.client.ZeebeClientBuilder’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2023-07-03T14:18:06.338+05:30 INFO 26076 — [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2023-07-03T14:18:06.374+05:30 INFO 26076 — [ main] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with ‘debug’ enabled.
2023-07-03T14:18:06.412+05:30 ERROR 26076 — [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Parameter 0 of method zeebeClientObjectFactory in io.camunda.zeebe.spring.client.ZeebeClientSpringConfiguration required a bean of type ‘io.camunda.zeebe.client.ZeebeClientBuilder’ that could not be found.

Action:

Consider defining a bean of type ‘io.camunda.zeebe.client.ZeebeClientBuilder’ in your configuration.


Thanks in Advance
Supriyo

Hi @jonathan.lukas
I am still not able to understand why this error is coming. I have followed all provided solutions but no luck. Any idea how to get rid of this? Please find attached my pom file and the springboot application file.


<?xml version="1.0" encoding="UTF-8"?>


4.0.0

org.springframework.boot
spring-boot-starter-parent
3.0.8


com.example
demo
0.0.1-SNAPSHOT
demo
Order Management Demo

<java.version>20</java.version>



org.springframework.boot
spring-boot-starter-actuator


org.springframework.boot
spring-boot-starter-jersey


org.springframework.boot
spring-boot-starter-web

	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<optional>true</optional>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
	    <groupId>org.springframework.boot</groupId>
	    <artifactId>spring-boot-starter-web</artifactId>
	</dependency>
	<dependency>
	  <groupId>io.camunda</groupId>
	  <artifactId>spring-zeebe-starter</artifactId>
	  <version>8.0.10</version>
	</dependency>
</dependencies>

<build>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
			<configuration>
				<excludes>
					<exclude>
						<groupId>org.projectlombok</groupId>
						<artifactId>lombok</artifactId>
					</exclude>
				</excludes>
			</configuration>
		</plugin>
	</plugins>
</build>
***

DemoApplication.java

package com.example.demo;

import io.camunda.zeebe.spring.client.EnableZeebeClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@EnableZeebeClient

public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
System.out.println(“SpringApplication Running”);
}
}


Thanks in Advance
Supriyo

1 Like

Hello @Supriyo ,

I could reproduce. Please add

@Import(ZeebeClientStarterAutoConfiguration.class)

as annotation on your main class. This will generate a bean of the required type. I wonder what broke it.

Jonathan

1 Like

Thank You @jonathan.lukas

1 Like