Skip to content

flex sql 审计类中的一个坑 #470

Description

@scf18857887860

因为AuditManager 中的一个静态属性

AuditManager
private static MessageFactory messageFactory = new DefaultMessageFactory();
DefaultMessageFactory
private final String hostIp = HttpUtil.getHostIp();
HttpUtil
public static String getHostIp() { try { for (Enumeration<NetworkInterface> net = NetworkInterface.getNetworkInterfaces(); net.hasMoreElements(); ) { NetworkInterface networkInterface = net.nextElement(); if (networkInterface.isLoopback() || networkInterface.isVirtual() || !networkInterface.isUp()) { continue; } for (Enumeration<InetAddress> addrs = networkInterface.getInetAddresses(); addrs.hasMoreElements(); ) { InetAddress addr = addrs.nextElement(); if (addr instanceof Inet4Address) { return addr.getHostAddress(); } } } } catch (Exception e) { // ignore } return "127.0.0.1"; }

当NetworkInterface.getNetworkInterfaces();方法阻塞时,导致我整个应用该程序都卡住,无法正常启动,请问有什么办法解决

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions