Description
gnodet:~/work/apps/apache-karaf-2.2.8$ bin/karaf Exception in thread "JMX Connector Thread [service:jmx:rmi://0.0.0.0:44444/jndi/rmi://0.0.0.0:1099/karaf-root]" java.lang.RuntimeException: Could not start JMX connector server at org.apache.karaf.management.ConnectorServerFactory$1.run(ConnectorServerFactory.java:233) Caused by: java.rmi.server.ExportException: Port already in use: 44444; nested exception is: java.net.BindException: Address already in use at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:310) at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:218) at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:393) at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:129) at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:188) at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293) at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:256) at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:82) at javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:75) at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:388) at org.apache.karaf.management.ConnectorServerFactory$1.run(ConnectorServerFactory.java:231) Caused by: java.net.BindException: Address already in use 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 java.net.ServerSocket.<init>(ServerSocket.java:106) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:27) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:333) at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:649) at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:299) ... 10 more __ __ ____ / //_/____ __________ _/ __/ / ,< / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/ /_/ |_|\__,_/_/ \__,_/_/ Apache Karaf (2.2.8) Hit '<tab>' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf. karaf@root>
Catching this exception and displaying a nicer and more informative message would be a good idea.