2023-06-23 19:30:00.167 [container-1000] INFO c.hykj.audio.listener.RedisKeyExpirationListerner - 收到Redis过期回调:AUDIO_IDLE
2023-06-23 19:30:10.191 [container-1001] INFO c.hykj.audio.listener.RedisKeyExpirationListerner - 收到Redis过期回调:AUDIO_IDLE
2023-06-23 19:30:20.243 [container-1002] INFO c.hykj.audio.listener.RedisKeyExpirationListerner - 收到Redis过期回调:AUDIO_IDLE
2023-06-23 19:30:30.261 [container-1003] INFO c.hykj.audio.listener.RedisKeyExpirationListerner - 收到Redis过期回调:AUDIO_IDLE
2023-06-23 19:30:40.285 [container-1004] INFO c.hykj.audio.listener.RedisKeyExpirationListerner - 收到Redis过期回调:AUDIO_IDLE
2023-06-23 19:30:50.327 [container-1005] INFO c.hykj.audio.listener.RedisKeyExpirationListerner - 收到Redis过期回调:AUDIO_IDLE
2023-06-23 19:31:00.356 [container-1006] INFO c.hykj.audio.listener.RedisKeyExpirationListerner - 收到Redis过期回调:AUDIO_IDLE
2023-06-23 19:31:10.382 [container-1007] INFO c.hykj.audio.listener.RedisKeyExpirationListerner - 收到Redis过期回调:AUDIO_IDLE
2023-06-23 19:31:20.424 [container-1008] INFO c.hykj.audio.listener.RedisKeyExpirationListerner - 收到Redis过期回调:AUDIO_IDLE
2023-06-23 19:31:21.153 [nioEventLoopGroup-5-1] WARN io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: 远程主机强迫关闭了一个现有的连接。
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:378)
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:256)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:357)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:750)
2023-06-23 19:31:21.154 [nioEventLoopGroup-5-1] INFO com.hykj.audio.handler.MqttNetCallback - 停止服务...
2023-06-23 19:31:21.318 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikarIDAtaSource - HikariPool-1 - Shutdown initiated...
2023-06-23 19:31:21.320 [SpringApplicationShutdownHook] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed.
2023-06-23 19:31:21.581 [SpringApplicationShutdownHook] WARN com.hykj.audio.utils.SerialPortUtils - 串口//./COM7关闭
2023-06-23 19:31:43.859 [main] INFO com.hykj.AudioApplication - Starting AudioApplication v1.0.0 using Java 1.8.0_361 on DESKTOP-KM9B675 with PID 200 (D:\hykj\server\hykj-audio.jar started by DESKTOP-KM9B675$ in D:\hykj\server)
2023-06-23 19:31:43.861 [main] INFO com.hykj.AudioApplication - The following 1 profile is active: "data"
2023-06-23 19:31:44.812 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode
2023-06-23 19:31:44.816 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023-06-23 19:31:44.844 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 12 ms. Found 0 Redis repository interfaces.
2023-06-23 19:31:45.640 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http)
2023-06-23 19:31:45.651 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"]
2023-06-23 19:31:45.651 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2023-06-23 19:31:45.651 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.73]
2023-06-23 19:31:45.760 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2023-06-23 19:31:45.760 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1854 ms
2023-06-23 19:31:47.463 [main] INFO c.hykj.framework.mqtt.config.MqttAutoConfiguration - hykj.audio
2023-06-23 19:31:47.463 [main] INFO c.hykj.framework.mqtt.config.MqttAutoConfiguration - 未配置Mqtt消息接收类 (此地方已经配置了回调,很多时候都是很可以重新启动成功,偶尔就会出现这个情况)
附上:回调成功log
2023-06-24 08:02:08.906 [main] INFO com.hykj.AudioApplication - Starting AudioApplication v1.0.0 using Java 1.8.0_361 on DESKTOP-KM9B675 with PID 6272 (D:\hykj\server\hykj-audio.jar started by DESKTOP-KM9B675$ in D:\hykj\server)
2023-06-24 08:02:08.914 [main] INFO com.hykj.AudioApplication - The following 1 profile is active: "data"
2023-06-24 08:02:09.938 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode
2023-06-24 08:02:09.941 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023-06-24 08:02:09.985 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 26 ms. Found 0 Redis repository interfaces.
2023-06-24 08:02:10.844 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http)
2023-06-24 08:02:10.854 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"]
2023-06-24 08:02:10.854 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2023-06-24 08:02:10.854 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.73]
2023-06-24 08:02:11.466 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2023-06-24 08:02:11.467 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 2498 ms
2023-06-24 08:02:13.326 [main] INFO c.hykj.framework.mqtt.config.MqttAutoConfiguration - hykj.audio
2023-06-24 08:02:13.327 [main] INFO c.hykj.framework.mqtt.config.MqttAutoConfiguration - 未配置Mqtt消息接收类
2023-06-24 08:02:13.578 [main] INFO c.hykj.framework.mqtt.config.MqttAutoConfiguration - mqt配置监听:topic:hykj.audio listener:com.hykj.audio.handler.MqttMessageListener
2023-06-24 08:02:13.583 [main] INFO c.hykj.framework.mqtt.config.MqttAutoConfiguration - mqtt增加回调配置:mqttNetCallback
2023-06-24 08:02:13.737 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"]
2023-06-24 08:02:13.749 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path ''
2023-06-24 08:02:14.055 [main] INFO com.hykj.AudioApplication - Started AudioApplication in 5.657 seconds (JVM running for 6.144)
2023-06-24 08:02:15.340 [main] INFO com.hykj.AudioRunner - 发现全部串口:[COM1, COM2, COM3, COM4, COM5, COM6, COM7, LPT1]
2023-06-24 08:02:15.340 [main] INFO com.hykj.AudioRunner - 打开指定portName:COM7
2023-06-24 08:02:15.340 [main] INFO com.hykj.audio.utils.SerialPortUtils - 打开串口COM7
2023-06-24 08:02:15.353 [main] INFO com.hykj.audio.utils.SerialPortUtils - 打开串口COM7成功
2023-06-24 08:02:18.546 [container-1] INFO c.hykj.audio.listener.RedisKeyExpirationListerner - 收到Redis过期回调:AUDIO_IDLE