Artemis: java.net.BindException: Cannot assign requested address - jms

I am trying to create a cluster of Artemis Servers. I have two artemis servers with following settings in the broker.xml as discussed in this documentation.
A snippet of broker.xml is as follows
<acceptors>
<!-- Acceptor for every supported protocol -->
<acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true</acceptor>
<!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.-->
<acceptor name="amqp">tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpMinLargeMessageSize=102400;amqpDuplicateDetection=true</acceptor>
<!-- STOMP Acceptor. -->
<acceptor name="stomp">tcp://0.0.0.0:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor>
<!-- HornetQ Compatibility Acceptor. Enables HornetQ Core and STOMP for legacy HornetQ clients. -->
<acceptor name="hornetq">tcp://0.0.0.0:5445?anycastPrefix=jms.queue.;multicastPrefix=jms.topic.;protocols=HORNETQ,STOMP;useEpoll=true</acceptor>
<!-- MQTT Acceptor -->
<acceptor name="mqtt">tcp://0.0.0.0:1883?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor>
</acceptors>
I added following to the broker.xml
<connectors>
<connector name="nettyartemis">tcp://localhost:61619</connector>
</connectors>
<discovery-groups>
<discovery-group name="my-discovery-group">
<local-bind-address>172.16.9.3</local-bind-address>
<group-address>231.7.7.7</group-address>
<group-port>9876</group-port>
<refresh-timeout>10000</refresh-timeout>
</discovery-group>
</discovery-groups>
<broadcast-groups>
<broadcast-group name="my-broadcast-group">
<local-bind-address>172.16.9.3</local-bind-address>
<local-bind-port>5432</local-bind-port>
<group-address>231.7.7.7</group-address>
<group-port>9876</group-port>
<broadcast-period>2000</broadcast-period>
<connector-ref>nettyartemis</connector-ref>
</broadcast-group>
</broadcast-groups>
In local-bind-address of discovery-groups I tried using 172.16.19.3, 172.16.19.7 and 172.16.19.8. Now, when I run one server it gives me following WARNING which (I think) means that the broadcast is not started resulting in no cluster.
2020-06-11 17:10:59,277 WARN [org.apache.activemq.artemis.core.server] AMQ222116: unable to start broadcast group my-broadcast-group: java.net.BindException: Cannot assign requested address: Cannot bind
at java.base/java.net.DualStackPlainDatagramSocketImpl.socketBind(Native Method) [java.base:]
at java.base/java.net.DualStackPlainDatagramSocketImpl.bind0(DualStackPlainDatagramSocketImpl.java:84) [java.base:]
at java.base/java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:131) [java.base:
at java.base/java.net.DatagramSocket.bind(DatagramSocket.java:394) [java.base:]
at java.base/java.net.DatagramSocket.<init>(DatagramSocket.java:244) [java.base:]
at java.base/java.net.DatagramSocket.<init>(DatagramSocket.java:301) [java.base:]
at org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory$UDPBroadcastEndpoint.openBroadcaster(UDPBroadcastEndpointFactory.java:176) [artemis-core-client-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.core.server.cluster.impl.BroadcastGroupImpl.start(BroadcastGroupImpl.java:105) [artemis-server-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.core.server.cluster.ClusterManager.start(ClusterManager.java:262) [artemis-server-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart2(ActiveMQServerImpl.java:2983) [artemis-server-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:76) [artemis-server-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:599) [artemis-server-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:526) [artemis-server-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:70) [artemis-cli-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:84) [artemis-cli-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:153) [artemis-cli-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:101) [artemis-cli-2.13.0.jar:2.13.0]
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:128) [artemis-cli-2.13.0.jar:2.13.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java.base:]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [java.base:]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java.base:]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) [java.base:]
at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:134) [artemis-boot.jar:2.13.0]
at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:50) [artemis-boot.jar:2.13.0]
2020-06-11 17:10:59,502 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:61616 for protocols [CORE,MQTT,AMQP,STOMP,HORNETQ,OPENWIRE]
2020-06-11 17:10:59,514 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:5445 for protocols [HORNETQ,STOMP]
Any suggestion why this is happening? I couldn't find any online resources explaining this on internet.

It might help someone else, I found my mistake just after posting this question
local-bind-address. This is the local bind address that the datagram
socket is bound to. If you have multiple network interfaces on your
server, you would specify which one you wish to use for broadcasts by
setting this property. If this property is not specified then the
socket will be bound to the wildcard address, an IP address chosen by
the kernel. This is a UDP specific attribute.
So this is ip address of the system where artemis server is running.

Related

Debian, Tomcat9 can not start https

I have problem with Tomcat9 and https on Debian.
Java: openjdk 11
WebApp runs on http, but no on https.
server.xml:
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443" />
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
sslProtocol="TLS"
keystoreFile="/opt/myjks.jks"
keystorePass="myjkspass"
/>
error in log:
26-Jan-2023 00:09:33.132 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
26-Jan-2023 00:09:33.774 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"]
26-Jan-2023 00:09:33.828 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["https-jsse-nio-443"]
26-Jan-2023 00:09:33.836 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[HTTP/1.1-443]]
org.apache.catalina.LifecycleException: Protocol handler initialization failed
at org.apache.catalina.connector.Connector.initInternal(Connector.java:1050)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:554)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1045)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.startup.Catalina.load(Catalina.java:724)
at org.apache.catalina.startup.Catalina.load(Catalina.java:746)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:307)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:477)
Caused by: java.net.SocketException: Operation not permitted
at java.base/sun.nio.ch.Net.bind0(Native Method)
at java.base/sun.nio.ch.Net.bind(Net.java:459)
at java.base/sun.nio.ch.Net.bind(Net.java:448)
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:275)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:230)
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1227)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1240)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:604)
at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:76)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:1047)
... 13 more
26-Jan-2023 00:09:33.837 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1112] milliseconds
I have no idea where the mistake is.
can you give me any advice?

ActiveMQ Artemis not starting on Windows 10: Failed to bind acceptor

I downloaded the zip from https://activemq.apache.org/components/artemis/download/ and unzipped it. Then I ran
artemis.cmd create broker2
I changed to the bin folder of broker2 and ran
artemis.cmd run
I tried it a lot of time, I restarted several times and tried again, I tried as administrator, I ran netstat -anb and verified nothing is running on port 1883, still the result is always:
D:\apache-artemis-2.15.0\bin\broker2\bin>artemis.cmd run
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector$1 (file:/D:/apache-artemis-2.15.0/lib/jaxb-impl-2.2.7.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
_ _ _
/ \ ____| |_ ___ __ __(_) _____
/ _ \| _ \ __|/ _ \ \/ | |/ __/
/ ___ \ | \/ |_/ __/ |\/| | |\___ \
/_/ \_\| \__\____|_| |_|_|/___ /
Apache ActiveMQ Artemis 2.15.0
Sep. 16, 2020 4:00:07 NACHM. java.lang.System$LoggerFinder lambda$accessProvider$0
WARNING: Failed to instantiate LoggerFinder provider; Using default.
2020-09-16 16:00:07,668 INFO [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server
2020-09-16 16:00:08,288 INFO [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)
2020-09-16 16:00:08,312 INFO [org.apache.activemq.artemis.core.server] AMQ221013: Using NIO Journal
2020-09-16 16:00:08,343 INFO [org.apache.activemq.artemis.core.server] AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 536.870.912
2020-09-16 16:00:08,363 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
2020-09-16 16:00:08,365 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
2020-09-16 16:00:08,366 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
2020-09-16 16:00:08,367 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for: MQTT
2020-09-16 16:00:08,367 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding protocol support for: OPENWIRE
2020-09-16 16:00:08,368 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP
2020-09-16 16:00:08,438 INFO [org.apache.activemq.artemis.core.server] AMQ221034: Waiting indefinitely to obtain live lock
2020-09-16 16:00:08,439 INFO [org.apache.activemq.artemis.core.server] AMQ221035: Live Server Obtained live lock
2020-09-16 16:00:09,607 INFO [org.apache.activemq.artemis.core.server] AMQ221080: Deploying address DLQ supporting [ANYCAST]
2020-09-16 16:00:09,669 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying ANYCAST queue DLQ on address DLQ
2020-09-16 16:00:09,750 INFO [org.apache.activemq.artemis.core.server] AMQ221080: Deploying address ExpiryQueue supporting [ANYCAST]
2020-09-16 16:00:09,774 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying ANYCAST queue ExpiryQueue on address ExpiryQueue
2020-09-16 16:00:10,542 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:61616 for protocols [CORE,MQTT,AMQP,STOMP,HORNETQ,OPENWIRE]
2020-09-16 16:00:10,553 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:5445 for protocols [HORNETQ,STOMP]
2020-09-16 16:00:10,564 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:5672 for protocols [AMQP]
2020-09-16 16:00:10,581 ERROR [org.apache.activemq.artemis.core.server] AMQ224104: Error starting the Acceptor mqtt {scheme=tcp, tcpReceiveBufferSize=1048576, port=1883, host=0.0.0.0, protocols=MQTT, useEpoll=true, tcpSendBufferSize=1048576}
2020-09-16 16:00:10,581 ERROR [org.apache.activemq.artemis.core.server] AMQ224000: Failure in initialisation: java.lang.IllegalStateException: AMQ229230: Failed to bind acceptor mqtt to 0.0.0.0:1883
at org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor.startServerChannels(NettyAcceptor.java:688) [artemis-server-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor.start(NettyAcceptor.java:456) [artemis-server-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl.startAcceptors(RemotingServiceImpl.java:313) [artemis-server-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.completeActivation(ActiveMQServerImpl.java:3090) [artemis-server-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:78) [artemis-server-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:603) [artemis-server-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:530) [artemis-server-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:61) [artemis-cli-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:90) [artemis-cli-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:153) [artemis-cli-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:101) [artemis-cli-2.15.0.jar:2.15.0]
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:128) [artemis-cli-2.15.0.jar:2.15.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java.base:]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [java.base:]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java.base:]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) [java.base:]
at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:134) [artemis-boot.jar:2.15.0]
at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:50) [artemis-boot.jar:2.15.0]
Caused by: java.net.BindException: Address already in use: bind
at java.base/sun.nio.ch.Net.bind0(Native Method) [java.base:]
at java.base/sun.nio.ch.Net.bind(Net.java:455) [java.base:]
at java.base/sun.nio.ch.Net.bind(Net.java:447) [java.base:]
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:219) [java.base:]
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:550) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) [artemis-commons-2.15.0.jar:2.15.0]
2020-09-16 16:00:10,586 INFO [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.15.0 [0.0.0.0, nodeID=edecc73f-f824-11ea-bed7-309c236ea6f2]
2020-09-16 16:00:10,857 INFO [org.apache.activemq.hawtio.branding.PluginContextListener] Initialized activemq-branding plugin
2020-09-16 16:00:10,956 INFO [org.apache.activemq.hawtio.plugin.PluginContextListener] Initialized artemis-plugin plugin
2020-09-16 16:00:11,936 INFO [io.hawt.HawtioContextListener] Initialising hawtio services
2020-09-16 16:00:11,961 INFO [io.hawt.system.ConfigManager] Configuration will be discovered via system properties
2020-09-16 16:00:11,962 INFO [io.hawt.jmx.JmxTreeWatcher] Welcome to hawtio 1.5.12 : http://hawt.io/ : Don't cha wish your console was hawt like me? ;-)
2020-09-16 16:00:11,969 INFO [io.hawt.jmx.UploadManager] Using file upload directory: D:\apache-artemis-2.15.0\bin\broker2\tmp\uploads
2020-09-16 16:00:11,982 INFO [io.hawt.web.AuthenticationFilter] Starting hawtio authentication filter, JAAS realm: "activemq" authorized role(s): "amq" role principal classes: "org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal"
2020-09-16 16:00:12,002 INFO [io.hawt.web.JolokiaConfiguredAgentServlet] Jolokia overridden property: [key=policyLocation, value=file:/D:/apache-artemis-2.15.0/bin/broker2/etc/\jolokia-access.xml]
2020-09-16 16:00:12,229 INFO [io.hawt.web.RBACMBeanInvoker] Using MBean [hawtio:type=security,area=jmx,rank=0,name=HawtioDummyJMXSecurity] for role based access control
2020-09-16 16:00:12,629 INFO [io.hawt.system.ProxyWhitelist] Initial proxy whitelist: [localhost, 127.0.0.1, 192.168.180.120, pc10.procheck24.de, 172.17.2.161, pc10.mshome.net]
2020-09-16 16:00:12,783 INFO [org.apache.activemq.artemis] AMQ241001: HTTP Server started at http://localhost:8161
2020-09-16 16:00:12,784 INFO [org.apache.activemq.artemis] AMQ241002: Artemis Jolokia REST API available at http://localhost:8161/console/jolokia
2020-09-16 16:00:12,785 INFO [org.apache.activemq.artemis] AMQ241004: Artemis Console available at http://localhost:8161/console
2020-09-16 16:00:13,086 INFO [io.hawt.HawtioContextListener] Destroying hawtio services
2020-09-16 16:00:13,088 INFO [io.hawt.web.AuthenticationFilter] Destroying hawtio authentication filter
2020-09-16 16:00:13,234 INFO [org.apache.activemq.hawtio.plugin.PluginContextListener] Destroyed artemis-plugin plugin
2020-09-16 16:00:13,245 INFO [org.apache.activemq.hawtio.branding.PluginContextListener] Destroyed activemq-branding plugin
2020-09-16 16:00:13,263 INFO [org.apache.activemq.artemis.core.server] AMQ221002: Apache ActiveMQ Artemis Message Broker version 2.15.0 [edecc73f-f824-11ea-bed7-309c236ea6f2] stopped, uptime 5.570 seconds
org.apache.activemq.artemis.component.WebTmpCleaner:Unable to read the logging configuration from 'file:../config/logging.properties' (java.io.FileNotFoundException: ..\config\logging.properties (Das System kann den angegebenen Pfad nicht finden))
What is missing to run a broker on a windows machine?
The root "Caused by" is this:
Caused by: java.net.BindException: Address already in use: bind
at java.base/sun.nio.ch.Net.bind0(Native Method) [java.base:]
at java.base/sun.nio.ch.Net.bind(Net.java:455) [java.base:]
at java.base/sun.nio.ch.Net.bind(Net.java:447) [java.base:]
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:219) [java.base:]
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:550) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) [artemis-commons-2.15.0.jar:2.15.0]
Here the JVM is working with the OS to bind a server socket to 0.0.0.0:1883. This operation is failing ostensibly because something is already bound to that address & port. This is an environmental issue between the JVM and the OS. It's not something the broker can overcome directly. The only thing you could do from the broker's perspective is to change the port, e.g.:
<acceptor name="mqtt">tcp://0.0.0.0:81883?protocols=MQTT</acceptor>
I have got this problem few times on my development machine (Windows 10).
No application working on port but AMQ could not acquire it.
I have no idea why problem occurred - I could not reproduce it on purpose.
For me restarting Windows has solved the issue.
I has been also trying logging out user as it (I think) it should kill user processes but with no effect.
Maybe there has been some issue with releasing port after improper AMQ closure?
<!-- MQTT Acceptor -->
<acceptor name="mqtt">tcp://0.0.0.0:4785?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor>
I changed the port of MQTT in broker2/etc/broker.xml to a random number and it worked, the broker was able to start. I still have no clue why port 1883 was not accessible (I also tried 1884 and it did not work either).

Failover appender not working for log4j2 version 2.7

My spring boot application uses Kafka as an appender for my logs using log4j2. The properties for the same are given below:
<Kafka name="kafkaAppender" topic="logs" ignoreExceptions="false" >
<PatternLayout pattern="%m%n" />
<Property name="bootstrap.servers">127.0.0.1:9092</Property>
</Kafka>
<Async name="Async" ignoreExceptions="false" >
<AppenderRef ref="kafkaAppender"/>
</Async>
The errors I get are :
kafka-producer-network-thread | producer-2] 2018-04-26 17:12:22,590 WARN org.apache.kafka.common.network.Selector [276] - Error in I/O with /127.0.0.1
java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.8.0_144]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[?:1.8.0_144]
at org.apache.kafka.common.network.Selector.poll(Selector.java:238) [kafka-clients-0.8.2.0.jar:?]
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:192) [kafka-clients-0.8.2.0.jar:?]
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:191) [kafka-clients-0.8.2.0.jar:?]
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:122) [kafka-clients-0.8.2.0.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
To fix the above errors I used failover appender given by log4j2 the configuration for which is given below:
<Failover name="Failover" primary="Async" ignoreExceptions="true" >
<Failovers>
<AppenderRef ref="RollingRandomAccessFile"/>
</Failovers>
</Failover>
Still instead of going to the appender given in the failover, the application prints the above errors continously and the below :
2018-04-26 17:05:37,196 restartedMain ERROR appender Failover has no parameter that matches element Failovers
Is there any way to fix the issue as people on log4j2 forums say that its a bug for Failover tag.
There is OPEN bug as of August 2019 in log4j2, which is causing the issue!
kindly find link here

Web-console Exception: No broker is found at any of the 1 configured urls

I'm trying to start the web-console in tomee+ 1.5.0, like it is shown here:
http://activemq.apache.org/web-console.html (Example configuration using Tomcat)
I use the following parameter when starting the server:
-Dcatalina.base="D:\Kit\apache-tomee-plus-1.5.0" -Dcatalina.home="D:\Kit\apache-tomee-plus-1.5.0" -Dwtp.deploy="D:\Kit\apache-tomee-plus-1.5.0\wtpwebapps" -Djava.endorsed.dirs="D:\Kit\apache-tomee-plus-1.5.0\endorsed" -Dwebconsole.type=properties -Dwebconsole.jms.url=tcp://localhost:61616 -Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi -Dwebconsole.jmx.user=tomee -Dwebconsole.jmx.password=tomee -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=1099
I can connect with jconsole to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi but I don't see the "org.apache.activemq" in MBeans. When I try to access the web-console at
http://localhost:8080/activemq-web-console-5.7.0/
I keep getting the following exception:
Caused by: java.lang.IllegalStateException: No broker is found at any of the 1 configured urls
at org.apache.activemq.web.RemoteJMXBrokerFacade.createConnection(RemoteJMXBrokerFacade.java:168)
This is the broker in the activemq.xml file of the web-console war:
<broker brokerName="web-console" useJmx="true" xmlns="http://activemq.apache.org/schema/core">
<persistenceAdapter>
<kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter>
<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:61616"/>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
</transportConnectors> </broker>
Can someone give me a hint regarding this problem?
The problem is related to the "Datasource" parameter from ActiveMQResourceAdapter. This version works:
<Resource id="JMSAdapter" type="ActiveMQResourceAdapter">
BrokerXmlConfig = broker:(tcp://localhost:61616)?persistent=false&useJmx=true
ServerUrl = tcp://localhost:61616
Datasource =
</Resource>
This is related to the following: https://issues.apache.org/jira/browse/TOMEE-474

Problems configuring https for Active Mq broker created in spring

Edit
From some experimentation I have noticed if I change my connector to:
<amq:transportConnector name="ssl" uri="ssl://localhost:61617"/>
Everything works fine, so I believe the problem is related to me needing some sort of additional configuration when using an https connector. Unfortunately the information available consists of http://activemq.apache.org/http-and-https-transports-reference.html and http://docs.codehaus.org/display/JETTY/How%20to%20configure%20SSL. Perhaps I am missing an additional step?
I have followed these instructions: http://activemq.apache.org/how-do-i-use-ssl.html
I have created a certificate as follows:
sudo keytool -keystore broker.ks -alias jetty -genkey -keyalg RSA
I have then put the broker.ks file on the classpath of my project in eclipse. I then have the following spring configuration:
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<amq:broker useJmx="false" persistent="false">
<amq:persistenceAdapter>
<amq:kahaDB />
</amq:persistenceAdapter>
<!-- Configure ssl -->
<amq:sslContext>
<amq:sslContext keyStore="broker.ks" keyStorePassword="password"/>
</amq:sslContext>
<!-- Only allow connection through http -->
<amq:transportConnectors>
<amq:transportConnector name="https" uri="https://localhost:443"/>
</amq:transportConnectors>
</amq:broker>
My keystore is definately on the classpath and the password is definately 'password' for both my password and key. However on running the application I am prompted with:
org.eclipse.jetty.ssl.password
I then enter 'password', then I am prompted with:
org.eclipse.jetty.ssl.keypassword
I enter 'password' again an receive:
WARN : org.eclipse.jetty.util.log - FAILED SslSocketConnector#localhost:443: java.net.BindException: Permission denied
WARN : org.eclipse.jetty.util.log - FAILED org.eclipse.jetty.server.Server#225f1ae9: java.net.BindException: Permission denied
ERROR: org.apache.activemq.broker.BrokerService - Failed to start ActiveMQ JMS Message Broker. Reason: java.net.BindException: Permission denied
java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at javax.net.ssl.SSLServerSocket.<init>(SSLServerSocket.java:106)
at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.<init>(SSLServerSocketImpl.java:108)
at com.sun.net.ssl.internal.ssl.SSLServerSocketFactoryImpl.createServerSocket(SSLServerSocketFactoryImpl.java:72)
at org.eclipse.jetty.server.ssl.SslSocketConnector.newServerSocket(SslSocketConnector.java:378)
at org.eclipse.jetty.server.bio.SocketConnector.open(SocketConnector.java:75)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:358)
at org.eclipse.jetty.server.bio.SocketConnector.doStart(SocketConnector.java:146)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.Server.doStart(Server.java:253)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.apache.activemq.transport.http.HttpTransportServer.doStart(HttpTransportServer.java:119)
at org.apache.activemq.transport.https.HttpsTransportServer.doStart(HttpsTransportServer.java:66)
at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
at org.apache.activemq.broker.TransportConnector.start(TransportConnector.java:246)
at org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:2162)
at org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:2073)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:519)
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:161)
at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:51)
at com.bbconnecttxt.activeMq.Broker.main(Broker.java:7)
From what I am aware I shouldn't be prompted to enter password at all.
Some operating systems require superuser (root) privileges to bind a connection to a privileged port (ports below 1024).
The following message basically reports that you are trying to bind to a port 443 (which is a privileged port) and you are not allowed to do this by the OS:
WARN : org.eclipse.jetty.util.log - FAILED SslSocketConnector#localhost:443: java.net.BindException: Permission denied
Try to configure the HTTPS for the ActiveMQ server to use port higher than 1024 for HTTPS, e.g. 8443. In general, it would be possible to run ActiveMQ under root user (not recommended), or use a tool like authbind, but reconfiguring the port should be the most easy change.

Resources