启动多个jboot报错,提示端口占用
在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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到问题的原因了,是因为两个应用的如下配置默认都是8000,手动改下即可