apache/dubbo · warning · IllegalArgumentException

Addresses is not allowed to be empty, please re-enter.

Error message

Addresses is not allowed to be empty, please re-enter.

What it means

Thrown by UrlUtils.parseURLs when REGISTRY_SPLIT_PATTERN.split(address) yields a null or empty array. The inline comment 'here won't be empty' indicates the developers consider this branch effectively unreachable — String.split always returns at least one element for non-null input, and the earlier isEmpty guard already excluded null/blank. Hitting this would indicate an unexpected split-pattern behavior.

Source

Thrown at dubbo-common/src/main/java/org/apache/dubbo/common/utils/UrlUtils.java:186

                        changed = true;
                        parameters.put(key, defaultValue);
                    }
                }
            }
        }
        if (changed) {
            u = new ServiceConfigURL(protocol, username, password, host, port, path, parameters);
        }
        return u;
    }

    public static List<URL> parseURLs(String address, Map<String, String> defaults) {
        if (StringUtils.isEmpty(address)) {
            throw new IllegalArgumentException("Address is not allowed to be empty, please re-enter.");
        }
        String[] addresses = REGISTRY_SPLIT_PATTERN.split(address);
        if (addresses == null || addresses.length == 0) {
            throw new IllegalArgumentException(
                    "Addresses is not allowed to be empty, please re-enter."); // here won't be empty
        }
        List<URL> registries = new ArrayList<>();
        for (String addr : addresses) {
            registries.add(parseURL(addr, defaults));
        }
        return registries;
    }

    public static Map<String, Map<String, String>> convertRegister(Map<String, Map<String, String>> register) {
        Map<String, Map<String, String>> newRegister = new HashMap<>();
        for (Map.Entry<String, Map<String, String>> entry : register.entrySet()) {
            String serviceName = entry.getKey();
            Map<String, String> serviceUrls = entry.getValue();
            if (StringUtils.isNotContains(serviceName, ':') && StringUtils.isNotContains(serviceName, '/')) {
                for (Map.Entry<String, String> entry2 : serviceUrls.entrySet()) {
                    String serviceUrl = entry2.getKey();
                    String serviceQuery = entry2.getValue();

View on GitHub (pinned to 3a3043227f)

Solutions

  1. Treat as a bug if encountered — file a Dubbo issue with the exact address string and pattern.
  2. Ensure the input address is a valid, non-empty registry URL string (the isEmpty guard at line 182 should have caught blank input).
  3. Verify REGISTRY_SPLIT_PATTERN has not been tampered with via reflection or classpath shading.
Defensive patterns

Strategy: try-catch

Validate before calling

// This branch is considered unreachable by the code authors.
// Validate input as for error 297 — ensure address is non-empty before calling parseURLs.

Try / catch

try {
    List<URL> urls = UrlUtils.parseURLs(address, defaults);
} catch (IllegalArgumentException e) {
    // investigate REGISTRY_SPLIT_PATTERN or report as Dubbo bug
}

Prevention

When it happens

Trigger: This branch is considered unreachable by the code authors. It could only trigger if a custom regex pattern (REGISTRY_SPLIT_PATTERN) were configured in a way that String.split returns an empty array, which does not happen with standard JDK behavior for non-empty input.

Common situations: Effectively never seen in practice. If observed, investigate whether REGISTRY_SPLIT_PATTERN was modified or whether a non-standard JVM split implementation is in use.

Related errors


AI-assisted analysis of apache/dubbo@3a3043227f (2026-08-14). Data as JSON: /api/errors/ce9a18eb3a90726a. Report an issue: GitHub.