vromero / activemq-artemis-docker

Dockerfile for the ActiveMQ Artemis Project
Apache License 2.0
199 stars 182 forks source link

Enabling jmx causing artemis command not to run #109

Closed kesavkolla closed 5 years ago

kesavkolla commented 5 years ago

I've created container with ENABLE_JMX_EXPORTER=true option. Everything is running fine but when connect to container and execute artemis command it throws error.

/var/lib/artemis/bin$ ./artemis
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at sun.net.httpserver.ServerImpl.bind(ServerImpl.java:133)
    at sun.net.httpserver.HttpServerImpl.bind(HttpServerImpl.java:54)
    at io.prometheus.jmx.shaded.io.prometheus.client.exporter.HTTPServer.<init>(HTTPServer.java:145)
    at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:49)
    ... 6 more
FATAL ERROR in native method: processing of -javaagent failed
Aborted (core dumped)

Any idea on how to fix this error? I was expecting to see the command line help when I run the artemis command. If I don't set the ENABLE_JMX_EXPORTER to true then the command works just fine.

vromero commented 5 years ago

Hi @kesavkolla, I'm afraid I don't fully understand your process or why you manually try to start an already started artemis. Could you please share exact reproduction steps?

Also try to run like this docker run -it --rm -e ENABLE_JMX_EXPORTER=true vromero/activemq-artemis:2.6.4