Kafka Extension : Startup fails with javax.xml.bin.JAXBException

I am evaluating HiveMQ and its Kafka Extension with a trial license for a proof of concept.
I have the HiveMQ broker running in an EKS cluster the the broker starts up and works fine.

I have created a configMap using kubectl for the Kafka Extension while updating my hivemq installation and enabling the kafka extenstion, I am getting the following exception in the hivemq pod

2022-11-02 21:00:58,029 INFO  - Starting extension with id "hivemq-kafka-extension" at /opt/hivemq/extensions/hivemq-kafka-extension
2022-11-02 21:00:58,038 ERROR - Error in the Kafka Extension. Could not initialize XML parser
javax.xml.bind.JAXBException: Error while searching for service [javax.xml.bind.JAXBContextFactory]
	at javax.xml.bind.ContextFinder$1.createException(Unknown Source)
	at javax.xml.bind.ContextFinder$1.createException(Unknown Source)
	at javax.xml.bind.ServiceLoaderUtil.firstByServiceLoader(Unknown Source)
	at javax.xml.bind.ContextFinder.find(Unknown Source)
	at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
	at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
	at a.e.<init>(Unknown Source)
	at a.a.<init>(Unknown Source)
	at a.c.<init>(Unknown Source)
	at o.o.a(Unknown Source)
	at o.r.a(Unknown Source)
	at o.r.a(Unknown Source)
	at o.r.get(Unknown Source)
	at dagger.internal.DoubleCheck.get(Unknown Source)
	at q.f.a(Unknown Source)
	at q.f.get(Unknown Source)
	at dagger.internal.DoubleCheck.get(Unknown Source)
	at n.b.b(Unknown Source)
	at com.hivemq.extensions.kafka.KafkaExtensionMain.extensionStart(Unknown Source)
	at hmq.da.l.a(Source.java:140)
	at hmq.da.m.d(Source.java:293)
	at hmq.dI.e.c(Source.java:82)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
	at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(Source.java:212)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.ServiceConfigurationError: javax.xml.bind.JAXBContextFactory: com.sun.xml.bind.v2.JAXBContextFactory not a subtype
	at java.base/java.util.ServiceLoader.fail(Unknown Source)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(Unknown Source)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(Unknown Source)
	at java.base/java.util.ServiceLoader$2.hasNext(Unknown Source)
	at java.base/java.util.ServiceLoader$3.hasNext(Unknown Source)
	... 25 common frames omitted
2022-11-02 21:00:58,038 ERROR - Not able to start Kafka extension. Reason:
2022-11-02 21:00:58,039 INFO  - Startup of extension with id "hivemq-kafka-extension" was prevented by the extension itself, reason: Not able to start Kafka extension, reason: javax.xml.bind.JAXBException: Error while searching for service [javax.xml.bind.JAXBContextFactory]
 - with linked exception:
[java.util.ServiceConfigurationError: javax.xml.bind.JAXBContextFactory: com.sun.xml.bind.v2.JAXBContextFactory not a subtype]. Extension will be disabled.

Any idea why the extension would complain about the JAXB library and not start up.

Hi @atimsina ,

Great that you are interested in HiveMQ, welcome to the Community Forum. The error looks very generic. Are you sure you have latest versions of the broker and extension? Which version of HiveMQ broker and Kafka Enterprise Extension are you evaluating? You can find exact versions in the hivemq.log file shortly after the startup.

Dasha from HiveMQ team

Hi Dasha, thanks for the response.

I am using the HiveMQ helm chart to install it in a EKS cluster. Wouldn’t that mean that I am using the latest version of HiveMQ. From the log/installation, I am using hivemq 4.9.

As for the extension, I am. Using the extension that comes with the broker (which is in disabled state when the broker starts).

Can you help confirm if the helm chart for HiveMQ is up to date?

Thanks for your help

I was using the wrong extensionUri in the hivemq extensions configuration, took your advice and was able to fix with the following

    - name: hivemq-kafka-extension
      extensionUri: preinstalled
      configMap: kafka-configuration
      enabled: true