getLocalMAC error

created at 02-23-2022 views: 2

problem

In the process of using logj4j once, the system reports getLocalMAC error when it starts up. By viewing the source code, it is found that the InetAddress.getLocalHost() method will obtain the name of the personal computer. If your personal computer name is the ip found by localhost It will be 127.0.0.1, resulting in an error.

solution

Just change the PC name to something other than localhost.

created at:02-23-2022
edited at: 02-23-2022: