com.ali.unit.rule.Router initialization failure

更新时间:
复制 MD 格式

This topic helps you resolve the NoClassDefFoundError for com.ali.unit.rule.Router that prevents an Enterprise Distributed Application Service (EDAS) application from starting.

Error message

The following error appears in the application startup logs:

SEVERE: Context initialization failed java.lang.NoClassDefFoundError: Could not initialize class com.ali.unit.rule.Router

Cause

The com.ali.unit.rule.Router class connects to the Address Server (jmenv.tbsite.net) during initialization. If the Address Server is unreachable, the Router class fails to load and triggers the NoClassDefFoundError.

This typically happens when the Address Server domain name jmenv.tbsite.net does not resolve to the IP address of your lightweight configuration center.

Diagnose the issue

Verify that the Address Server is unreachable from your machine:

ping jmenv.tbsite.net

If ping returns unknown host or times out, the domain name is not resolving correctly. Proceed to the solution.

Solution

Map the Address Server domain name to your lightweight configuration center IP address in the hosts file.

  1. Open the hosts file in a text editor.

    Operating systemHosts file path
    WindowsC:\Windows\System32\drivers\etc\hosts
    Linux/etc/hosts
  2. Add the following entry. Replace <your-config-center-ip> with the IP address of your lightweight configuration center.

    <your-config-center-ip> jmenv.tbsite.net

    Example:

    192.168.1.10 jmenv.tbsite.net
  3. Save the file and restart your application.

Verify the fix

After you update the hosts file, confirm the domain resolves correctly:

ping jmenv.tbsite.net

The command should return responses from the IP address you configured. Restart the application and check that the NoClassDefFoundError no longer appears in the startup logs.