Details

    • Similar Issues:
      Show 10 results 

      Description

      I was looking why the server didn't not boot cleanly after the change in the parent issue and it turns out it triggers a bug in Main.ServerConfigUtil.fixRemoteAddressProperty.

      public static void fixRemoteAddressProperty(String systemPropertyName,
      String defaultValue)
      {
      String old = System.getProperty(systemPropertyName);
      if (old == null)
      {
      if (defaultValue != null)

      { String fixed = fixRemoteAddress(old); <<< HERE should be 'defaultValue' instead System.setProperty(systemPropertyName, fixed); }

      }
      else

      { String fixed = fixRemoteAddress(old); System.setProperty(systemPropertyName, fixed); }

      }

        Gliffy Diagrams

          Activity

          Hide
          dimitris Dimitris Andreadis added a comment -

          Brian changed org.jboss.Main from:
          // Fix up other bind addresses
          String bindAddress = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS);
          if (System.getProperty("java.rmi.server.hostname") == null)
          System.setProperty("java.rmi.server.hostname", bindAddress);
          To:
          // Make sure some address properties are set and/or don't specify
          // a "any local address" value that's useless for their intended usage
          String defaultAddress = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS);
          ServerConfigUtil.fixRemoteAddressProperty("java.rmi.server.hostname", defaultAddr)

          So essentially if 'java.rmi.server.hostname' is not specified (which is not for most cases) the 'fixed jboss.bind.address should be used instead.

          The problem was that Main.ServerConfigUtil.fixRemoteAddressProperty() ignores defaultValue and just puts InetAddress.getLocalHost().getHostName() in the specified property.

          And that caused the RMI server codebase to point to a non-local address, even though the server binds by default to 128.0.0.1

          20:24:04,828 INFO [WebService] Using RMI server codebase: http://poseidon:1083/

          Show
          dimitris Dimitris Andreadis added a comment - Brian changed org.jboss.Main from: // Fix up other bind addresses String bindAddress = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS); if (System.getProperty("java.rmi.server.hostname") == null) System.setProperty("java.rmi.server.hostname", bindAddress); To: // Make sure some address properties are set and/or don't specify // a "any local address" value that's useless for their intended usage String defaultAddress = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS); ServerConfigUtil.fixRemoteAddressProperty("java.rmi.server.hostname", defaultAddr) So essentially if 'java.rmi.server.hostname' is not specified (which is not for most cases) the 'fixed jboss.bind.address should be used instead. The problem was that Main.ServerConfigUtil.fixRemoteAddressProperty() ignores defaultValue and just puts InetAddress.getLocalHost().getHostName() in the specified property. And that caused the RMI server codebase to point to a non-local address, even though the server binds by default to 128.0.0.1 20:24:04,828 INFO [WebService] Using RMI server codebase: http://poseidon:1083/
          Hide
          dimitris Dimitris Andreadis added a comment -

          Fixed in Branch_5_x

          Show
          dimitris Dimitris Andreadis added a comment - Fixed in Branch_5_x
          Hide
          alrubinger Andrew Rubinger added a comment -

          Fix in trunk, then resolve

          Show
          alrubinger Andrew Rubinger added a comment - Fix in trunk, then resolve
          Hide
          alrubinger Andrew Rubinger added a comment -

          Against trunk:

          [alr@localhost trunk]$ grep -R 'fixRemoteAddressProperty' .
          Binary file ./main/target/classes/org/jboss/Main$ServerConfigUtil.class matches
          Binary file ./main/target/classes/org/jboss/Main.class matches
          ./main/src/main/org/jboss/Main.java: ServerConfigUtil.fixRemoteAddressProperty("java.rmi.server.hostname", defaultAddress);
          ./main/src/main/org/jboss/Main.java: ServerConfigUtil.fixRemoteAddressProperty("jgroups.bind_addr", defaultAddress);
          ./main/src/main/org/jboss/Main.java: ServerConfigUtil.fixRemoteAddressProperty("bind.address", null);
          ./main/src/main/org/jboss/Main.java: public static void fixRemoteAddressProperty(String systemPropertyName,

          Show
          alrubinger Andrew Rubinger added a comment - Against trunk: [alr@localhost trunk] $ grep -R 'fixRemoteAddressProperty' . Binary file ./main/target/classes/org/jboss/Main$ServerConfigUtil.class matches Binary file ./main/target/classes/org/jboss/Main.class matches ./main/src/main/org/jboss/Main.java: ServerConfigUtil.fixRemoteAddressProperty("java.rmi.server.hostname", defaultAddress); ./main/src/main/org/jboss/Main.java: ServerConfigUtil.fixRemoteAddressProperty("jgroups.bind_addr", defaultAddress); ./main/src/main/org/jboss/Main.java: ServerConfigUtil.fixRemoteAddressProperty("bind.address", null); ./main/src/main/org/jboss/Main.java: public static void fixRemoteAddressProperty(String systemPropertyName,
          Hide
          dimitris Dimitris Andreadis added a comment -

          Ok fixed in trunk, too. Thanks.

          Show
          dimitris Dimitris Andreadis added a comment - Ok fixed in trunk, too. Thanks.

            People

            • Assignee:
              dimitris Dimitris Andreadis
              Reporter:
              dimitris Dimitris Andreadis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development