connect: Address is invalid on local machine or port is not valid on remote

Posted lvlv岁月流逝

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了connect: Address is invalid on local machine or port is not valid on remote相关的知识,希望对你有一定的参考价值。

idea 运行正常打成jar包运行提示“connect: Address is invalid on local machine or port is not valid on remote” ,

解决方法:

 public static void main(String[] args) throws ParseException {

        System.setProperty("java.net.preferIPv4Stack" , "true");
}

在main方法中加入“System.setProperty("java.net.preferIPv4Stack" , "true");”

原因,jdk跑jar默认使用的是ipv6。

以上是关于connect: Address is invalid on local machine or port is not valid on remote的主要内容,如果未能解决你的问题,请参考以下文章

Oracle RAC JDBC connection string

what is MAC address

MySQL 消失了:Connection_errors_peer_address 的数字很高

uniapp开发微信小程序跳转出现navigateTo:fail page "pages/user/pages/user/address/address" is not found

Address localhost:1099 is already in use

Address localhost:1099 is already in use(IDEA启动Tomcat报错1099 is already in use)