Closed tobyweston closed 6 years ago
Create a random port with
-Dcom.sun.management.jmxremote.port=0
but then it's tricky to communicate the chosen port with the outside world. One way would be to rely on Java's logging:
# jmx_logging.properties
handlers=java.util.logging.ConsoleHandler
.level=INFO
java.util.logging.ConsoleHandler.level=CONFIG
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
sun.management.jmxremote.level=CONFIG
and
-Djava.util.logging.config.file=jmx_logging.properties
which outputs the following on startup (which should appear in the main log TBC):
ConnectorBootstrap startRemoteConnectorServer
CONFIG: JMX Connector ready at: service:jmx:rmi:///jndi/rmi://UKLONLT929592:53250/jmxrmi
Fixed in 2.1
Trying to start up with the
temperature-machine
command (or even to check the version) will fail if it is already running. The message is as follows.It'd be nicer to report that the server is already running and to stop it before trying again.
The following
...will return
0
if it is running (could use port1616
also). Could use this in the startup script to check and fail before even trying to startup the JVM.