Skip to content

[错误报告]: Unable to retrieve localhost #6859

Open
@H-Dynamite

Description

@H-Dynamite

确认

  • 我使用的版本是最新版, 并且使用插件确认过项目里无依赖版本冲突
  • 我已经在 issue 中搜索过, 确认问题没有被提出过
  • 我已经修改标题, 将标题中的 描述 替换为遇到的问题(不得删除 描述 前面的部分)

当前程序版本

31.5.0.1

问题描述

场景:当没有插入网线的情况,并且根据hostname查找不到ip的时候,mybatis-plus无法初始化
原因:NetUtils findFirstNonLoopbackAddress方法先获取插入网线的地址,如果获取不到,使用InetAddress.getLocalHost()获取本地地址。
期望:当没有插入网线或hostname配置错误时候,依然能初始化成功
Image

Image

详细堆栈日志

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions