在idea中,启动多个main,端口8080,启动成功了一个,改了另外一个main的启动端口为8090,但是启动后还是抱端口占用的错误。
[DEBUG][2018-08-15 10:17:09][buffer.ByteBufUtil.debug(76)]> -Dio.netty.maxThreadLocalCharBufferSize: 16384
java.lang.RuntimeException: java.net.BindException: Address already in use
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:600)
at io.jboot.server.undertow.UnderTowServer.initUndertowServer(UnderTowServer.java:104)
at io.jboot.server.undertow.UnderTowServer.start(UnderTowServer.java:192)
at io.jboot.Jboot.startServer(Jboot.java:168)
at io.jboot.Jboot.start(Jboot.java:149)
at io.jboot.Jboot.run(Jboot.java:92)
at com.jzdoctor.component.system.Application.main(Application.java:82)
Caused by: java.net.BindException: Address already in use
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:558)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1283)
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:989)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:254)
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:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:748)
[ERROR][2018-08-15 10:17:09][undertow.UnderTowServer.start(196)]> can not start undertow with port:8090
<p>找到问题的原因了,是因为两个应用的如下配置默认都是8000,手动改下即可</p>
jboot.rpc.defaultPort
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。