Details

    • Type: Sub-task Sub-task
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 6.0.0.M1
    • Component/s: System service
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • 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); }

      }

        Activity

        Hide
        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 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 Andreadis
        added a comment -

        Fixed in Branch_5_x

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

        Fix in trunk, then resolve

        Show
        Andrew Rubinger
        added a comment - Fix in trunk, then resolve
        Hide
        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
        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 Andreadis
        added a comment -

        Ok fixed in trunk, too. Thanks.

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: