开发者社区> 问答> 正文

java.net.BindException: Address already in use 重启

lsof -i:9400 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 17789 root 71u IPv4 2073488550 0t0 TCP ####:sec-t4net-srv->####:sec-t4net-srv (ESTABLISHED)

执行 lsof 会得到一个 sec-t4net-srv 的进程

https://developer.aliyun.com/article/888860 根据此链接获知

[root@###### /home/project/service/running/canal/logs/canal]# cat /etc/services |grep 9400 sec-t4net-srv 9400/tcp # Samsung Twain for Network Server sec-t4net-srv 9400/udp # Samsung Twain for Network Server

问题

org.jboss.netty.channel.ChannelException: Failed to bind to: 0.0.0.0/0.0.0.0:9400 at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:303) ~[netty-3.2.2.Final.jar:na] at com.alibaba.otter.canal.server.netty.CanalServerWithNetty.start(CanalServerWithNetty.java:99) ~[canal.server-1.1.4.jar:na] at com.alibaba.otter.canal.deployer.CanalController.start(CanalController.java:533) ~[canal.deployer-1.1.4.jar:na] at com.alibaba.otter.canal.deployer.CanalStarter.start(CanalStarter.java:78) ~[canal.deployer-1.1.4.jar:na] at com.alibaba.otter.canal.deployer.CanalLauncher.main(CanalLauncher.java:115) ~[canal.deployer-1.1.4.jar:na] Caused by: java.net.BindException: Address already in use at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_191] at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_191] at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_191] at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.8.0_191] at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_191] at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.bind(NioServerSocketPipelineSink.java:148) ~[netty-3.2.2.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleServerSocket(NioServerSocketPipelineSink.java:100) ~[netty-3.2.2.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:74) ~[netty-3.2.2.Final.jar:na] at org.jboss.netty.channel.Channels.bind(Channels.java:468) ~[netty-3.2.2.Final.jar:na] at org.jboss.netty.channel.AbstractChannel.bind(AbstractChannel.java:200) ~[netty-3.2.2.Final.jar:na] at org.jboss.netty.bootstrap.ServerBootstrap$Binder.channelOpen(ServerBootstrap.java:348) ~[netty-3.2.2.Final.jar:na] at org.jboss.netty.channel.Channels.fireChannelOpen(Channels.java:176) ~[netty-3.2.2.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketChannel.(NioServerSocketChannel.java:85) ~[netty-3.2.2.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.newChannel(NioServerSocketChannelFactory.java:142) ~[netty-3.2.2.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.newChannel(NioServerSocketChannelFactory.java:90) ~[netty-3.2.2.Final.jar:na] at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:282) ~[netty-3.2.2.Final.jar:na] ... 4 common frames omitted

原提问者GitHub用户bestK

展开
收起
白夜行fighting 2023-04-25 20:30:05 225 0
1 条回答
写回答
取消 提交回答
  • Address already in use,肯定是有端口冲突

    原回答者GitHub用户agapple

    2023-04-26 17:17:07
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载