java.net.BindException: Address already in use: bind
环境:jxse-2.7, netty-3.6.6.Final
现象:每次执行都抛出以下异常
八月 08, 2013 8:45:19 下午 net.jxta.logging.Logging logCheckedInfo
INFO: Line 127 net.jxta.impl.endpoint.netty.NettyTransportServer.bindServerChannel()
Attempt to bind to /0.0.0.0:8080 failed (Address already in use: bind), trying another address
八月 08, 2013 8:45:19 下午 org.jboss.netty.channel.SimpleChannelUpstreamHandler
WARNING: EXCEPTION, please implement org.jboss.netty.channel.socket.httptunnel.TunnelWrappedServerChannelHandler.exceptionCaught() for proper handling.
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:366)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:290)
at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
——————————————————————————————————————————————————————————————————
注意到黄色背景文字,显然8080端口被占用了;才想起最近安装Oracle Database 11g Express Edition,在安装时必须占用8080端口且无法修改。
停止Oracle服务,或按照《http://www.cnblogs.com/cuizhf/p/3246654.html》修改其端口。
上面的异常也说明Jxta绑定了8080端口(Why?),下面是NettyTransportServer初始化时的代码:
private void initServer(TCPAdv instanceConfiguration) throws PeerGroupException { this.serverEnabled = instanceConfiguration.isServerEnabled(); if(!serverEnabled) {
this.server = new NullTransportServerComponent();
return;
} String interfaceAddress = instanceConfiguration.getInterfaceAddress(); InetAddress bindAddr;
if(interfaceAddress != null) {
bindAddr = TransportUtils.resolveInterfaceAddress(interfaceAddress);
} else {
bindAddr = IPUtils.ANYADDRESS;
} String publicName = instanceConfiguration.getServer();
EndpointAddress publicAddress = null;
if (publicName != null) {
publicAddress = new EndpointAddress(protocolName, publicName, null, null);
} NettyTransportServer server = new NettyTransportServer(createServerSocketChannelFactory(), new InetSocketAddressTranslator(protocolName), group); int preferredPort = correctPort(instanceConfiguration.getPort(), 1, 65535, getDefaultPort(), getDefaultPort(), "Preferred");
int startPort = correctPort(instanceConfiguration.getStartPort(), 1, preferredPort, getDefaultPortRangeLowerBound(), 1, "Range start");
int endPort = correctPort(instanceConfiguration.getEndPort(), startPort, 65535, getDefaultPortRangeUpperBound(), 65535, "Range end");
List<InetSocketAddress> potentialBindpoints = IPUtils.createRandomSocketAddressList(bindAddr, preferredPort, startPort, endPort); server.init(potentialBindpoints, publicAddress, instanceConfiguration.getPublicAddressOnly());
this.server = server;
}
java.net.BindException: Address already in use: bind的更多相关文章
- Jenkins启动时报错:java.net.BindException: Address already in use: bind 解决方法
下载jenkins.war包后,进入Jenkins.war包目录下,运行java -jar jenkins.war时报端口被占用的错误:java.net.BindException: Address ...
- 解决 java.net.BindException: Address already in use (Bind failed)
这是因为tomcat未正确关闭导致的端口占用问题 找到报错中被占用的端口kill掉进程即可,一般是8080,也有下面这种8005的 11-Mar-2019 14:46:12.405 SEVERE [m ...
- Caused by: java.net.BindException: Address already in use: bind
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brandService ...
- springboot 出现异常 java.net.BindException: Address already in use: bind
java.net.BindException: Address already in use: bind
- 解决springboot 出现异常: java.net.BindException: Address already in use: bind
解决springboot 出现异常: java.net.BindException: Address already in use: bind 这是引文在启动springboot 的时候,没有关闭端口 ...
- IDEA启动报错-java.net.BindException: Address already in use: bind
启动IDEA报错日志如下: Internal error. Please refer to http://jb.gg/ide/critical-startup-errors java.net.Bind ...
- IDEA错误:Failed to start end point associated with ProtocolHandler [http-nio-9999] java.net.BindException: Address already in use: bind
日志显示进程端口已被占用,首先需要的是查询什么进程占用了当前的9999端口. 1.win+R输入cmd进入命令界面: 2.输入命令 netstat -ano|findstr "端口号&qu ...
- 端口占用问题:java.net.BindException: Address already in use: bind
解决方法 方法一:换一个端口 若仍然想要使用该端口,则可以将占用该端口的进程杀死即可. 方法二:杀死占用该端口的进程 若仍然想要使用该端口,则可以将占用该端口的进程杀死即可 查找端口被占用的进程id ...
- 解决java.net.BindException: Address already in use(Bind failed)端口占用问题
问题描述: 解决办法: sudo lsof -i:20101ps -ef|grep 9905kill -9 9905ps -ef|grep 9905 ------------------------- ...
随机推荐
- linux内核链表分析
一.常用的链表和内核链表的区别 1.1 常规链表结构 通常链表数据结构至少应包含两个域:数据域和指针域,数据域用于存储数据,指针域用于建立与下一个节点的联系.按照指针域的组织以及各个节 ...
- Image.FrameDimensionsList 属性-----具体使用案例2
图片的拆分 1.保存png图片 using System; using System.Collections.Generic;using System.ComponentModel;using Sys ...
- overload和override
Overload是重载的意思,Override是覆盖的意思,也就是重写. 重载Overload表示同一个类中可以有多个名称相同的方法,但这些方法的参数列表各不相同(即参数个数或类型不同). 重写Ove ...
- kindeditor编辑器图片水印
//upload_pic.ashx源码 <%@ webhandler Language="C#" class="edit_html_upload_pic" ...
- 修改数据库中group_concat的返回结果的长度限制
修改数据库中group_concat的返回结果的长度限制 我们可以使用Mysql的客户端管理工具,Sqlyog 新建一个查询编辑器 显示 SHOW VARIABLES LIKE "grou ...
- HDU 5312 Sequence (规律题)
题意: 一个序列的第n项为3*n*(n-1)+1,而 n>=1,现在给一个正整数m,问其最少由多少个序列中的数组成? 思路: 首先,序列第1项是1,所以任何数都能构成了.但是最少应该是多少?对式 ...
- UIView 设置alpha后, 子view也随着变化alpha, 解决方法
// _closeContainerBar.alpha = 0.7; _closeContainerBar.backgroundColor = [[UIColor blackColor] ...
- [转](多实例)mysql-mmm集群
一.需求说明 最近一直在学习mysql-mmm,想以后这个架构也能用在我们公司的业务上,我们公司的业务是单机多实例部署,所以也想把mysql-mmm部署成这样,功夫不负有心人,我成功了,和大家分享一下 ...
- Ejabberd源码解析前奏--管理
一.ejabberdctl 使用ejabberdctl命令行管理脚本,你可以执行ejabberdctl命令和一些普通的ejabberd命令(后面会详细解说).这意味着你可以在一个本地或远程ejabbe ...
- 通过userAgent判断手机浏览器类型
我们可以通过userAgent来判断,比如检测某些关键字,例如:AppleWebKit*****Mobile或AppleWebKit,需要注意的是有些浏览器的userAgent中并不包含AppleWe ...