Spring Boot External Task Client Unsatisfied dependency

Hello everybody,
I’m trying to use some examples from the External Task Client for Spring Boot.
https://docs.camunda.org/manual/latest/user-guide/ext-client/spring-boot-starter/#handler-configuration-example
I’m basically copy pasting the code and I’m getting an error that I cannot seem to figure out.
I added a handler as in the example and an error is popping. I’m using a spring boot java 11, the bpmn diagram was added to my camunda.


import org.camunda.bpm.client.spring.annotation.ExternalTaskSubscription;
import org.camunda.bpm.client.task.ExternalTaskHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class HandlerConfiguration {

  @Bean
  @ExternalTaskSubscription(
		  topicName = "creditScoreChecker",
		  processDefinitionKey = "loan_process",
		  includeExtensionProperties = true,
		  variableNames = "defaultScore"
		  )
  public ExternalTaskHandler creditScoreCheckerHandler() {
    return (externalTask, externalTaskService) -> {
      // add your business logic here
      externalTaskService.complete(externalTask);
    };
  }

  @Bean
  @ExternalTaskSubscription( 
		  topicName = "loanGranter",
		  processDefinitionKey = "loan_process",
		  includeExtensionProperties = true,
		  variableNames = "defaultScore"
		  )
  public ExternalTaskHandler loanGranterHandler() {
    return (externalTask, externalTaskService) -> {
      // add your business logic here
      externalTaskService.complete(externalTask);
    };
  }

}

Error:


org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean 
with name 'creditScoreCheckerHandlerSubscription': Unsatisfied dependency expressed 
through field 'client'; nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'externalTaskClient': FactoryBean threw exception on object creation; 
nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
	
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with
 name 'externalTaskClient': FactoryBean threw exception on object creation; nested exception is 
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException



application yaml

camunda.bpm.client:
  base-url: http://my_camunda:8080/engine-rest
  subscriptions:
    creditScoreChecker:
        process-definition-key: loan_process
        include-extension-properties: true
        variable-names: defaultScore
    loanGranter:
        process-definition-key: loan_process
        include-extension-properties: true
        variable-names: defaultScore

pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.5.5</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>org.my.org</groupId>
	<artifactId>JavaBoilerplate</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>JavaBoilerplate</name>
	<description>Demo project for Spring Boot</description>
	<properties>
		<java.version>11</java.version>
	</properties>
	<dependencies>
	<dependency>
	  <groupId>org.camunda.bpm.springboot</groupId>
	  <artifactId>camunda-bpm-spring-boot-starter-external-task-client</artifactId>
	  <version>7.15.0</version>
	</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>
	</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>

</project>

Thanks beforehand.

Hi @HTevar

Welcome to the forum! :wave:
Can you let me know what version of Java you’re running?
(Sorry- don’t mind me i just saw you’re running java 11)

I’ll take a look and get back to you :slight_smile:

I’m using a spring boot java 11

1 Like

OK, so i think you just need to add this to your Pom

<dependency>
    <groupId>javax.xml.bind</groupId>
     <artifactId>jaxb-api</artifactId>
    <version>2.3.0</version>
 </dependency>
1 Like

Hi @HTevar / @Alex_Voloshyn,

It will solve the problem based on @Niall’s input. In addition to that there’s detailed information why we need to add jaxb-api in higher versions of jdk.

Wow, you are great, fixed! :v: :v:

1 Like

Thank you @Niall , that fixed ‘my’ issue.

For project which use org.springframework.boot:spring-boot-starter-parent:2.5.x, jaxb-api version is set already by spring-boot-dependencies, so version can be skipped.

Could JAXB dependency be set by Camunda artifact?