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 in OSGi environment (such as equinox) might lead to ClassCastException during LoggingBootstrap if logback based logging is already setup in OSGi.
!STACK 0
java.util.concurrent.CompletionException: java.lang.ClassCastException: class ch.qos.logback.classic.LoggerContext cannot be cast to class ch.qos.logback.classic.LoggerContext (ch.qos.logback.classic.LoggerContext is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @f14a7d4; ch.qos.logback.classic.LoggerContext is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @673d71d5)
at java.base/java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:413)
at java.base/java.util.concurrent.CompletableFuture.join(CompletableFuture.java:2118)
...
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:343)
Caused by: java.lang.ClassCastException: class ch.qos.logback.classic.LoggerContext cannot be cast to class ch.qos.logback.classic.LoggerContext (ch.qos.logback.classic.LoggerContext is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @f14a7d4; ch.qos.logback.classic.LoggerContext is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @673d71d5)
at com.hivemq.bootstrap.LoggingBootstrap.getRootLogger(LoggingBootstrap.java:145)
at com.hivemq.bootstrap.LoggingBootstrap.prepareLogging(LoggingBootstrap.java:67)
...
Obviously this seems to be a class loading issue in OSGi environment.
For a more detailed description, see this forum contribution.
Preferred solution or suggestions
From my point of view, two possible solutions are considerable:
Add a new method to EmbeddedHiveMQBuilder to programmatically switch off logging
Add a system property, such as hivemq.log.bootstrap.disabled to conditionally switch off logging
The latter one possibly might have less drawbacks regarding backward compatibility, as only class HiveMQServer has to get adjusted a little bit ...
The text was updated successfully, but these errors were encountered:
Problem or use case
Incorporating EmbeddedHiveMQ in OSGi environment (such as equinox) might lead to ClassCastException during
LoggingBootstrap
if logback based logging is already setup in OSGi.Obviously this seems to be a class loading issue in OSGi environment.
For a more detailed description, see this forum contribution.
Preferred solution or suggestions
From my point of view, two possible solutions are considerable:
EmbeddedHiveMQBuilder
to programmatically switch off logginghivemq.log.bootstrap.disabled
to conditionally switch off loggingThe latter one possibly might have less drawbacks regarding backward compatibility, as only class
HiveMQServer
has to get adjusted a little bit ...The text was updated successfully, but these errors were encountered: