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.RouterCause
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.netIf 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.
Open the hosts file in a text editor.
Operating system Hosts file path Windows C:\Windows\System32\drivers\etc\hosts Linux /etc/hosts Add the following entry. Replace
<your-config-center-ip>with the IP address of your lightweight configuration center.<your-config-center-ip> jmenv.tbsite.netExample:
192.168.1.10 jmenv.tbsite.netSave the file and restart your application.
Verify the fix
After you update the hosts file, confirm the domain resolves correctly:
ping jmenv.tbsite.netThe 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.