7 Replies Latest reply on May 30, 2004 5:39 AM by hbaxmann

    how to avoid JNDI port conflicts at startup?

    davekohr

      We run JBoss 3.2.3 on Windows 2000 systems, and at startup we often have a fatal error due to a port number conflict betweenJBoss' JNDI and other processes that are temporarily using that same port number. Up to now we have used just the default JNDI port of 1099. I am thinking to try to avoid this problem by picking a much higher port number (like say 11099) that is less likely to be taken by some other process.

      As I understand it, there is no "well known port" for JNDI. So is there any other guidance about how to pick a port number that won't have conflicts?

        • 1. Re: how to avoid JNDI port conflicts at startup?

          Most likely it is Instant Messaging running on port 1099

          Regards,
          Adrian

          • 2. Re: how to avoid JNDI port conflicts at startup?
            davekohr

            Actually, most of the time it seems the process using port 1099 has something to do with CIFS (Windows network filesystem) access to mapped network drives. But thanks for the suggestion.

            This problem must come up often on Win2K systems. Is there a recommended solution?

            • 3. Re: how to avoid JNDI port conflicts at startup?
              mgingell

              FYI, Any application that uses RMI will likely use port 1099 (and 1098) as these are the "well known" ports for the rmiregistry and rmi activation. I would really like to know what the recommended solution is too! I have some applications that use JINI (with RMI) and I can't start the RMIregistry on the default port if Jboss is running, and I can't start JNDI (Jboss) on default port if the rmiregistry is running...

              • 4. Re: how to avoid JNDI port conflicts at startup?

                So just change the port of your naming service... ?

                • 5. Re: how to avoid JNDI port conflicts at startup?
                  davekohr

                  Yes, we definitely need to change the port number.

                  The question is, is there a way to pick a fixed port number that will basically never have conflicts.

                  I'm running on a Windows 2000 system. We had been using port 1099 for JNDI, but it seems that sometimes, some other process has grabbed that port. As I understand it, a port numbered over 1023 can be grabbed by basically any process. And such ports are typically chosen dynamically to create socket connections for other protocols like HTTP.

                  1099 is pretty close to 1023, and I believe these dynamically-assigned ports are generally chosen in increasing numerical order. So if I pick a much higher port number, like 11099, it's very unlikely to be used either for a dynamically-assigned port, or as the "well known port" for some other protocol. Just as 8080 works well as an alternate port for HTTP.

                  So is this solution the standard one? Is it reliable? Is there a better way?

                  Thanks in advance.

                  • 6. Re: how to avoid JNDI port conflicts at startup?
                    • 7. Re: how to avoid JNDI port conflicts at startup?
                      hbaxmann

                      If you want to have a full automatic port allocation and discovery process, than use and extend the ServiceBindingManager for dynamic port allocation and publish the StoreURL over a standardized port like LDAP or HTTP for the clients.

                      But I am in doubt, if this efforts are good for hiding organizational flaws.

                      bax