You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Incorporating EmbeddedHiveMQ into frameworks like Spring Boot 3 leads to clashes regarding the JAXB implementation for config file reading, as dependencies are generally managed by Spring Boot.
As a work-around, required dependencies must get downgraded manually in order to make EmbeddedHiveMQ work.
This in turn leads to clashes in conjunction with other state-of-the-art components.
Motivation
Java EE has been rebranded to Jakarta EE several years ago, relocating packages from javax.xml.bind to jakarta.xml.bind
No drawbacks expected on the stand-alone version of HiveMQ-CE , as all dependencies are packed into a shadowed jar
No manual downgrade of JAXB dependencies for Spring Boot 3
Possible drawbacks in OSGi frameworks easily resolvable on a per-bundle-basis
Possible drawbacks
Requirement to upgrade dependencies and possibly code to jakarta-style JAXB on other systems using EmbeddedHiveMQ
Preferred solution or suggestions
for dependency jaxb-api use package: jakarta.xml.bind:jakarta.xml.bind-api:4.0.2
for dependency jaxb-impl use package: org.glassfish.jaxb:jaxb-runtime:4.0.5
Refactoring of all import statement from javax.xml.bind to jakarta.xml.bind
The text was updated successfully, but these errors were encountered:
Tested suggested solution locally, all tests passed.
Tested outcomings in current Spring Boot 3.4.0, works as expected, no downgrade of JAXB dependencies required anymore.
If desired and appropriate I can make a pull request.
+1 on upgrading to Jakarta dependencies. I encountered the same problem trying to use HiveMQ Community Edition in embedded mode in a Spring Boot 3 application. I was able to work around this using Eclipse Transformer to convert the HiveMQ jar and replace javax with Jakarta, and override the HiveMQ dependencies to more modern versions:
<!-- Needed for HiveMQ update to Jakarta -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>4.0.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>7.0.0</version>
</dependency>
This seems to work but I don’t know if there will be other runtime issues, and it’s required me to add a lot of manual steps to my project’s POM. It would be really nice if HiveMQ could update to modern Jakarta dependencies so this isn’t a problem.
Problem or use case
Incorporating EmbeddedHiveMQ into frameworks like Spring Boot 3 leads to clashes regarding the JAXB implementation for config file reading, as dependencies are generally managed by Spring Boot.
As a work-around, required dependencies must get downgraded manually in order to make EmbeddedHiveMQ work.
This in turn leads to clashes in conjunction with other state-of-the-art components.
Motivation
Possible drawbacks
Preferred solution or suggestions
The text was updated successfully, but these errors were encountered: