我有现有的 Spring Boot 应用程序。我想在 spring boot 应用程序中启用 ratpack 支持。我正在添加ratpack springboot 依赖和@EnableRatpack 注释,然后启动应用程序。我收到以下异常。如何解决此异常?添加了进程 5620 的图片 - 我假设 netty 启动了所有这些进程。
依赖
def ratpackVersion = '1.5.0'
compile "io.ratpack:ratpack-spring-boot-starter:$ratpackVersion"
例外
[DEBUG] io.netty.channel.DefaultChannelId - -Dio.netty.processId: 5620 (auto-detected)
[DEBUG] io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false
[DEBUG] io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false
[DEBUG] io.netty.util.NetUtil - Loopback interface: lo (Software Loopback Interface 1, 127.0.0.1)
[DEBUG] io.netty.util.NetUtil - \proc\sys\net\core\somaxconn: 200 (non-existent)
[DEBUG] io.netty.channel.DefaultChannelId - -Dio.netty.machineId: 34:e6:d7:ff:fe:48:02:42 (auto-detected)
[DEBUG] io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled
[DEBUG] io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 65536
[DEBUG] io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
[ERROR] org.springframework.boot.SpringApplication - Application startup failed
java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:803)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:784)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:771)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at com.agenabio.Application.main(Application.java:65)
Caused by: java.net.BindException: Address already in use: bind
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:554)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1258)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486)