背景:写的微信推送公众号消息方法,测试的时候没有收到对应的微信公众号推送

原因:java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: PKIX path validation failed(更多错误信息在后面)

分析:查看日志,发现不是自己写的方法有报错,自己写的方法非常顺畅。而是调用微信接口的推送方法时出现的报错。报错翻译为-“validity check failed 有效性检查失败”。继续查看发现现在时间为2022-10-16,测试那边的时间为2033-10-16,微信那边判定有问题,于是不显示推送。

解决方案:将时间改为现在的时间

图为自己写的代码方法与调用微信的行

2033-10-16 09:51:18.556 TID:27c2ee76cb854279871a33a64f2ee0f5.139.20130402779750427 [Credit-Async-6] ERROR c.t.c.c.s.system.WechatMessagePushServiceImpl:76 - 发送用户审核结果失败,json= [{"name":"first","value":"尊敬的客户,您好。"},{"name":"keyword1","value":"陈科可可可"},{"name":"keyword2","value":"2033-10-16"},{"name":"keyword3","value":"600.00"},{"name":"keyword4","value":"2202202210143"},{"name":"keyword5"},{"color":"#173177","name":"remark","value":"祝您生活愉快!"}]
java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
	at me.chanjar.weixin.mp.api.impl.WxMpServiceHttpClientImpl.getAccessToken(WxMpServiceHttpClientImpl.java:100)
	at me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl.executeInternal(BaseWxMpServiceImpl.java:337)
	at me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl.execute(BaseWxMpServiceImpl.java:302)
	at me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl.post(BaseWxMpServiceImpl.java:281)
	at me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl.post(BaseWxMpServiceImpl.java:286)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:206)
	at com.sun.proxy.$Proxy417.post(Unknown Source)
	at me.chanjar.weixin.mp.api.impl.WxMpTemplateMsgServiceImpl.sendTemplateMsg(WxMpTemplateMsgServiceImpl.java:35)
	at com.tcl.credit.core.service.system.WechatMessagePushServiceImpl.sendMsg(WechatMessagePushServiceImpl.java:73)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:206)
	at com.sun.proxy.$Proxy418.sendMsg(Unknown Source)
	at com.tcl.credit.biz.service.impl.notice.wechat.WechatBizNoticeServiceImpl.sendCustomerAuditResultWxMsg(WechatBizNoticeServiceImpl.java:73)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
	at org.apache.skywalking.apm.plugin.spring.async.SWCallable.call(SWCallable.java:47)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
	at sun.security.ssl.Alert.createSSLException(Alert.java:131)

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐