服务器启动socket服务报错 java.net.BindException:Cannot assign requested address
错误信息:
java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:554)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1258)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:980)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:250)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:365)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:748)
服务器是阿里云的linux系统,socket是基于netty的socket服务端
socket服务的ip是服务器外网ip,端口是9005
经查看该端口并没有被占用
测试使用内网ip与相同端口启动服务启动成功
经过排查,最终的结果是,这个服务器使用的阿里云专用网络,直接用内网ip启动socket服务, 外部可以使用外网ip直接访问。
最后就是 : 用内网ip与9005端口启动socket服务端, 客户端通过 ws://服务器外网ip:9005 连接即可
服务器启动socket服务报错 java.net.BindException:Cannot assign requested address的更多相关文章
- tomcat启动端口号报错java.net.BindException: Cannot assign requested address
异常信息 时间:2017-02-09 15:09:59,829 - 级别:[ERROR] - 消息: [other] Failed to start end point associated with ...
- Tomcat启动报错:StandardServer.await: create[8005] java.net.BindException: Cannot assign requested address
Tomcat启动报错:StandardServer.await: create[8005] java.net.BindException: Cannot assign requested addres ...
- Tomcat启动报错:java.net.BindException: Cannot assign requested address: JVM_Bind
Tomcat启动报错:java.net.BindException: Cannot assign requested address: JVM_Bind Tomcat Cannot assign re ...
- Tomcat启动报错:严重: StandardServer.await: create[8005] java.net.BindException: Cannot assign requested address
org.apache.catalina.core.StandardServer await SEVERE: StandardServer.await: create[8005]: ...
- Tomcat启动异常 java.net.BindException: Cannot assign requested address: JVM_Bind
从Apache官网下载的tomcat7,在MyEclipse中启动时抛出如下异常: 严重: StandardServer.await: create[localhost:8005]: java.net ...
- DataNode启动不成功——java.net.BindException: Port in use: localhost:0 Caused by: java.net.BindException: Cannot assign requested address解决办法
爱折腾的人总是会出线各种奇怪的问题.记得之前听一位大师讲过,我们不能踩完前进路上的所有坑前进,而应该学会怎样避开前进路上的坑,踩得坑越多,可能你的经验越丰富,但是付出的时间代价可能不是经验能换来的.我 ...
- com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Cannot assign requested address: bind
在发布 web service 时报错: Endpoint.publish(publishAddress, hl7MessageReveiver); com.sun.xml.internal.ws.s ...
- tomcat java.net.BindException: Cannot assign requested address 解决方法
今天线上TOMCAT启动时遇到了下比较麻烦的问题,错误如下: 21-Apr-2016 15:14:19.077 SEVERE [main] org.apache.catalina.core.Stand ...
- java.net.BindException: Cannot assign requested address: bind
异常信息 时间:2017-03-16 10:21:05,644 - 级别:[ERROR] - 消息: [other] Failed to start end point associated with ...
随机推荐
- Python——socketserver编程(客户端/服务器)
一.socketserver是标准库中的高级模块,它的目标是简化很多多样板代码,是创建网络客户端和服务器所必须的代码.(事件驱动) 二.模块类 BaseServer :包含核心服务器功能和mix-in ...
- java的jdk
https://blog.fondme.cn/apidoc/jdk-1.8-baidu/
- CMDB服务器管理系统【s5day88】:采集资产-文件配置(二)
上节疑问: 1.老师我们已经写到global_settings里了,为什么还要写到__init__.py setting 这的作用是为了:整合起两个的组合global_settings和setting ...
- 第一节:从面向对象思想(oo)开发、接口、抽象类以及二者比较
一. 面向对象思想 1. 面向过程(OP)和面向对象(OO)的区别: (1):面向过程就是排着用最简单的代码一步一步写下去,没有封装,当业务复杂的时候,改动就很麻烦了 (2):面向对象将复杂的业务分离 ...
- jquery 倒计时效果
function daojishi(){ var starttime = new Date("2017-09-30 01:06:11"); //date的格式也可以写成:" ...
- split host
# encoding:utf-8 _portprog = None def split_host_port(host): """ split the host :para ...
- PHP数组——数组正则表达式、数组、预定义数组
正则表达式 1.替换 $s = "hello5world"; $s = preg_replace("/\d/","#",$s); echo ...
- c#管理文件系统
using System; using System.Collections.Generic; using System.IO; using static System.Console; /*Syst ...
- day 13 - 1 迭代器
迭代器 首先我们查看下列类型拥有的所有方法(会显示很多) print(dir([])) print(dir({})) print(dir('')) print(dir(range(10))) #求下上 ...
- Django对于模型的数据操作
一.引入模型的包 from myApp.models import Grades,Students 二.查询所有数据 #objecs是类的隐藏属性:类名.objects.all()可以查询所有数据 G ...