ActiveMQ Artemis 未在 Windows 10 上启动:无法绑定接受器

问题描述 投票:0回答:5

我从 https://activemq.apache.org/components/artemis/download/ 下载了 zip 并解压。然后我就跑了

 artemis.cmd create broker2

我换到broker2的bin文件夹下运行

artemis.cmd run

我尝试了很多次,我重新启动了几次并再次尝试,我以管理员身份尝试,我运行了

netstat -anb
并验证了端口1883上没有任何东西正在运行,但结果始终是:

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))

在 Windows 机器上运行代理缺少什么?

windows mqtt activemq-artemis
5个回答
2
投票

我在我的开发机器(Windows 10)上遇到过几次这个问题。 端口上没有应用程序运行,但 AMQ 无法获取它。

我不知道为什么会出现问题 - 我无法故意重现它。

对我来说,重新启动 Windows 已经解决了这个问题。 我也一直在尝试注销用户,因为它(我认为)它应该杀死用户进程,但没有效果。 也许在 AMQ 关闭不当后释放端口时出现了一些问题?


1
投票

“因”的根源是这样的:

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]

这里 JVM 正在与操作系统一起将服务器套接字绑定到

0.0.0.0:1883
。此操作表面上失败是因为某些内容已绑定到该地址和端口。这是 JVM 和操作系统之间的环境问题。这不是经纪人可以直接克服的。从经纪人的角度来看,您唯一可以做的就是更改端口,例如:

<acceptor name="mqtt">tcp://0.0.0.0:81883?protocols=MQTT</acceptor>

0
投票
  <!-- MQTT Acceptor -->
         <acceptor name="mqtt">tcp://0.0.0.0:4785?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor>

我将broker2/etc/broker.xml中的MQTT端口更改为随机数,它起作用了,代理能够启动。我仍然不知道为什么端口 1883 无法访问(我也尝试过 1884,但它也不起作用)。


0
投票

我也遇到了完全相同的问题。我已经在broker.xml配置中将服务器地址0.0.0.0替换为127.0.0.1(警告,虽然它不一样,但对于本地测试来说,它很好),它工作起来就像微风一样。


0
投票

检查端口 5672 上的进程并杀死它

netstat -ano|findstr 5672

taskkill /f /pid

© www.soinside.com 2019 - 2024. All rights reserved.