diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java index 6156c15877..700b863827 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java @@ -410,6 +410,15 @@ public interface ActiveMQClientLogger extends BasicLogger { format = Message.Format.MESSAGE_FORMAT) void confirmationNotSet(); + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212075, value = "KQueue is not available, please add to the classpath or configure useKQueue=false to remove this warning", + format = Message.Format.MESSAGE_FORMAT) + void unableToCheckKQueueAvailabilityNoClass(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212076, value = "Epoll is not available, please add to the classpath or configure useEpoll=false to remove this warning", + format = Message.Format.MESSAGE_FORMAT) + void unableToCheckEpollAvailabilitynoClass(); @LogMessage(level = Logger.Level.ERROR) @Message(id = 214000, value = "Failed to call onMessage", format = Message.Format.MESSAGE_FORMAT) diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/CheckDependencies.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/CheckDependencies.java index fb7da4b3ff..c29b17c70e 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/CheckDependencies.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/CheckDependencies.java @@ -34,6 +34,9 @@ public class CheckDependencies { public static final boolean isEpollAvailable() { try { return Env.isLinuxOs() && Epoll.isAvailable(); + } catch (NoClassDefFoundError noClassDefFoundError) { + ActiveMQClientLogger.LOGGER.unableToCheckEpollAvailabilitynoClass(); + return false; } catch (Throwable e) { ActiveMQClientLogger.LOGGER.unableToCheckEpollAvailability(e); return false; @@ -43,6 +46,9 @@ public class CheckDependencies { public static final boolean isKQueueAvailable() { try { return Env.isMacOs() && KQueue.isAvailable(); + } catch (NoClassDefFoundError noClassDefFoundError) { + ActiveMQClientLogger.LOGGER.unableToCheckKQueueAvailabilityNoClass(); + return false; } catch (Throwable e) { ActiveMQClientLogger.LOGGER.unableToCheckKQueueAvailability(e); return false;