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 ------------------------- ...
随机推荐
- android logcat里面AndroidRuntime FATAL EXCEPTION: main这个是什么问题啊。
android logcat里面AndroidRuntime FATAL EXCEPTION: main这个是什么问题啊. http://zhidao.baidu.com/link?url=mUI11 ...
- Lotus Notes中编程发送邮件(二)
在编程发送各种类似通知的邮件时,时常会需要发件人显示为某个特定的帐户,比如某个部门的名称或者管理员的名字.另一种需求是,用户收到某封邮件后,回复邮件的地址不同于发件人栏显示的地址.而正常情况下,发送邮 ...
- UVa 11178 (简单练习) Morley's Theorem
题意: Morley定理:任意三角形中,每个角的三等分线,相交出来的三个点构成一个正三角形. 不过这和题目关系不大,题目所求是正三角形的三个点的坐标,保留6位小数. 分析: 由于对称性,求出D点,EF ...
- HDU 3336 (KMP next性质) Count the string
直接上传送门好了,我觉得他分析得非常透彻. http://972169909-qq-com.iteye.com/blog/1114968 #include <cstdio> #includ ...
- C#计算程序执行速度
long t1 = DateTime.Now.Ticks; //执行程序,例如处理100个文件 long t2 = DateTime.Now.Ticks; Response.Write("执 ...
- 由于管理员设置的策略,该磁盘处于脱机状态-Win 2008 R2
问题截图: 做了个小说网站www.114369.cn,使用的是云主机,系统是Win 2008 R2,进入服务器后发现磁盘有问题 只有c盘,没有d盘,提示:由于管理员设置的策略,该磁盘处于脱机状态 解决 ...
- 为什么会出现ADB rejected shell command
出现这个问题,是由于在运行过程中,android emulator 没有打开,可以在run configurations--target- automatic-设置自己的android-version ...
- linux shell ls -1 列显示文件
/******************************************************************************* * linux shell ls -1 ...
- POJ 1523 SPF (割点,连通分量)
题意:给出一个网络(不一定连通),求所有的割点,以及割点可以切分出多少个连通分量. 思路:很多种情况. (1)如果给的图已经不是连通图,直接“ No SPF nodes”. (2)求所有割点应该不难 ...
- windows 下FFMPEG的编译方法 附2012-9-19发布的FFMPEG编译好的SDK下载
经过一晚上加一上午的奋斗,终于成功编译出了最新版的FFMPEG,下面是我编译的心得,因为是最新的,应该会对大家有用,编译的FFMPEG的版本是0.11.2,2012-09-19新发布的版本 平台:WI ...