The issue popped-up using logstash-logback-encoder providing JSON logs for ELK stack. During the initialization it quits with
java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.<init>(JaxbAnnotationIntrospector.java:137)
at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.<init>(JaxbAnnotationIntrospector.java:124)
at com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule.setupModule(JaxbAnnotationModule.java:98)
at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:879)
at com.fasterxml.jackson.databind.ObjectMapper.registerModules(ObjectMapper.java:1081)
at com.fasterxml.jackson.databind.ObjectMapper.findAndRegisterModules(ObjectMapper.java:1165)
So I checked the Jackson modules on the classpath and identified com.fasterxml.jackson.module:jackson-module-jaxb-annotations being propagated from camunda-engine-rest-core:7.20 as a transitive dependency:
I analyzed the code of the Jackson Module - it tries to load the JaxbAnnotationIntrospector importing the old annotation class which is not available anymore, once you made a transition to Jakarta world.
Expected behaviour
com.fasterxml.jackson.module:jackson-module-jaxb-annotations is not a transitive dependency.
Actual behaviour
com.fasterxml.jackson.module:jackson-module-jaxb-annotations is a transitive dependency.
Maybe it is a quite good idea to use camunda-bpm-api instead of the full blown engine with transitive dependencies, provided for all possible use cases.
Steps to reproduce
Description
The issue popped-up using
logstash-logback-encoder
providing JSON logs for ELK stack. During the initialization it quits withSo I checked the Jackson modules on the classpath and identified
com.fasterxml.jackson.module:jackson-module-jaxb-annotations
being propagated fromcamunda-engine-rest-core:7.20
as a transitive dependency:I analyzed the code of the Jackson Module - it tries to load the
JaxbAnnotationIntrospector
importing the old annotation class which is not available anymore, once you made a transition to Jakarta world.Expected behaviour
com.fasterxml.jackson.module:jackson-module-jaxb-annotations
is not a transitive dependency.Actual behaviour
com.fasterxml.jackson.module:jackson-module-jaxb-annotations
is a transitive dependency.Workaround
Exclude the dependency from the classpath.
Additional thoughts
Maybe it is a quite good idea to use camunda-bpm-api instead of the full blown engine with transitive dependencies, provided for all possible use cases.