环境: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的更多相关文章

  1. Jenkins启动时报错:java.net.BindException: Address already in use: bind 解决方法

    下载jenkins.war包后,进入Jenkins.war包目录下,运行java -jar jenkins.war时报端口被占用的错误:java.net.BindException: Address ...

  2. 解决 java.net.BindException: Address already in use (Bind failed)

    这是因为tomcat未正确关闭导致的端口占用问题 找到报错中被占用的端口kill掉进程即可,一般是8080,也有下面这种8005的 11-Mar-2019 14:46:12.405 SEVERE [m ...

  3. Caused by: java.net.BindException: Address already in use: bind

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brandService ...

  4. springboot 出现异常 java.net.BindException: Address already in use: bind

    java.net.BindException: Address already in use: bind

  5. 解决springboot 出现异常: java.net.BindException: Address already in use: bind

    解决springboot 出现异常: java.net.BindException: Address already in use: bind 这是引文在启动springboot 的时候,没有关闭端口 ...

  6. 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 ...

  7. 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 ...

  8. 端口占用问题:java.net.BindException: Address already in use: bind

    解决方法 方法一:换一个端口 若仍然想要使用该端口,则可以将占用该端口的进程杀死即可. 方法二:杀死占用该端口的进程 若仍然想要使用该端口,则可以将占用该端口的进程杀死即可 查找端口被占用的进程id ...

  9. 解决java.net.BindException: Address already in use(Bind failed)端口占用问题

    问题描述: 解决办法: sudo lsof -i:20101ps -ef|grep 9905kill -9 9905ps -ef|grep 9905 ------------------------- ...

随机推荐

  1. android下activity中多个listview只允许主界面滚动

    之前发现了自己的APP在处理两个listview时产生的一个bug.当两个listview中的item数量多出手机屏幕时,listview不能显示完全.一开始觉得只要加一个scrollview就可以了 ...

  2. linux内核链表分析

    一.常用的链表和内核链表的区别 1.1  常规链表结构        通常链表数据结构至少应包含两个域:数据域和指针域,数据域用于存储数据,指针域用于建立与下一个节点的联系.按照指针域的组织以及各个节 ...

  3. IOS把文件保存进沙盒目录

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSS ...

  4. IOS地址

    IOS开发-你不可缺少的资源汇总-知识分享-转   如何用Facebook graphic api上传视频: http://developers.facebook.com/blog/post/532/ ...

  5. 解决 “无法安装 Visual Studio 2010 Service Pack 1,因为此计算机的状态不支持”

    http://blog.csdn.net/davidhsing/article/details/8762621 无法安装Microsoft visual studio 2010 service pac ...

  6. Android开发之权限列表

    权限定义 功能 android.permission.ACCESS_CHECKIN_PROPERTIES 允许读写访问"properties"表在checkin数据库中,改值可以修 ...

  7. Webbrowser模拟百度一下子点击事件

    Webbrowser模拟百度一下点击事件新建一个form,有一个button和一个webbrowser控件.然后webbrowser一开始加载的就是百度主页.然后在文本框里输入点东西,如何做到点击bu ...

  8. yeoman运行grunt serve 提示错误

    今天在使用 yeoman 的时候,当我运行 grunt serve 命令的时候,出现如下提示: 1.Error: Cannot find module 'load-grunt-tasks' $ gru ...

  9. [58 Argo]58同城开源web框架Argo搭建实践

    无意间听说58开源的消息(Long long ago),我辈欣喜异常. 一方面感谢开源同仁的辛苦劳动,另一方面也为我辈在互联网技术实践圈外的人提供了一条实践的渠道. 我迫不及待的从github上dow ...

  10. CodeForces 489C (贪心) Given Length and Sum of Digits...

    题意: 找出m位且各个数位数字之和为s的最大和最小整数,不包括前导0(比如说003是非法的),但0是可以的. 分析: 这题是用贪心来做的,同样是m位数,前面的数字越大这个数就越大. 所以写一个can( ...