异常信息:Unexpected exception occurred invoking async method: public com.*.order.user.web.pojo.pojo.BotMessageResult com.*.order.user.web.service.impl.FeiShuServiceImpl.sendAlertMessageByModel(com.*.order.user.web.pojo.pojo.FeiShuStockAlertModel) 服务名称:*-order-user-web Pod: *-order-user-web-deployment-feature-refund-order-6f7ffdrcpwn Container: *-order-user-web Namespace: class IP:172.16.16.17 发生时间:2024-05-2919:20:08 请求类型: 跟踪traceId:bee0670551ec8dd4 源: 异常信息:I/O error on POST request for "http://zeus.corp.*.club/portal/prod/api/notification/sendWebhook/23": Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out 异常堆栈: `org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://zeus.corp.*.club/portal/prod/api/notification/sendWebhook/23": Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:746) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:672) at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:581) at com.*.order.user.web.service.impl.FeiShuServiceImpl.sendBotMessage(FeiShuServiceImpl.java:55) at com.*.order.user.web.service.impl.FeiShuServiceImpl.sendAlertMessageByModel(FeiShuServiceImpl.java:77) at com.*.order.user.web.service.impl.FeiShuServiceImpl$$FastClassBySpringCGLIB$$c152dde3.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88) at io.opentracing.contrib.spring.cloud.async.TraceAsyncAspect.traceBackgroundThread(TraceAsyncAspect.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)`
需要在项目中显示注入restTemplate,如下,解决问题
1 2 3 4 5 6 7 8 9
@Configuration publicclassRestTemplateConfig {
@Bean public RestTemplate restTemplate(){ returnnewRestTemplate(); }
t.p.r.http.vertx.VertxTransporter [VertxTransporter] post to url[URL(serverType=SERVER, address=172.31.110.9:10010, location=HandlerLocation(rootPath=server, methodPath=workerHeartbeat))] failed,msg: NoClassDefFoundError: Could not initialize class io.vertx.core.http.HttpHeaders "}
解决步骤如下:
command + o 搜索 io.vertx.core.http.HttpHeaders 这个类,下载源码,发现有红线报错。找到报错地方,显示应用如下依赖