吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1108|回复: 6
收起左侧

[求助] 各位大佬,help help !

[复制链接]
MomentCode 发表于 2023-6-25 09:25
各位大佬好,最近本地运行项目,(客户端是一台工控机,24小时不关机的),服务端是 winserver环境,运行的是一套交互的系统,具体表现如下:
1.服务端接收来自其他渠道的报警信息,放入redis
2.客户端从redis中取报警信息文本
3.redis删除此信息

目前在运行过程中,老是出现 偶尔出现如下报错:error log 如下:

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

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

XuYiXin 发表于 2023-6-25 16:10
加上断线重连,判断如果socket异常,did为空,不进行接下来的逻辑
XuYiXin 发表于 2023-6-25 16:10
或者改成HTTP上传!SOCKET只做连接状态,定时心跳!
Vvvvvoid 发表于 2023-6-25 17:15
400h297004533 发表于 2023-6-27 19:35
检查网络连接:确认客户端和服务端之间的网络连接是否稳定,并确保没有任何防火墙或网络配置导致通信中断。

检查串口连接:确认串口COM7的连接是否正常,检查是否有其他应用程序正在使用该串口。

检查Redis状态:确保Redis正常运行,并检查与Redis的通信是否正常。

分析报错现象:如果问题仍然存在,可以尝试根据报错发生的时间、频率以及相关操作的上下文来分析问题。查看是否有其他报错或警告信息,以及是否有特定的操作触发了报错。
 楼主| MomentCode 发表于 2023-6-29 11:05
XuYiXin 发表于 2023-6-25 16:10
加上断线重连,判断如果socket异常,did为空,不进行接下来的逻辑

已经加上去了,但是,并且也能成功回调,但是偶尔也不行....
 楼主| MomentCode 发表于 2023-6-29 11:07
400h297004533 发表于 2023-6-27 19:35
检查网络连接:确认客户端和服务端之间的网络连接是否稳定,并确保没有任何防火墙或网络配置导致通信中断。 ...

感谢大佬,我这边按照流程捋一下
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-24 21:36

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表