Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-1574

When two karaf containers are started locally, an exception is displayed at startup. A nicer message would be better.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.7
    • 2.2.9, 2.3.0, 3.0.0
    • None
    • None

    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.

      Attachments

        1. karaf-3.0_1574.diff
          2 kB
          Heath Kesler
        2. karaf-2.3_1574.diff
          2 kB
          Heath Kesler

        Activity

          People

            ffang Freeman Yue Fang
            gnodet Guillaume Nodet
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: