记录一次特离谱的启动报错

记录一次特离谱的启动报错

2024-11-29 19:42:23.073 ERROR 743 --- [           main] c.w.p.c.apache.httpclient.SignatureExec  : 应答的状态码不为200-299。status code[401]	request headers[[Accept: application/json; charset=UTF-8, Authorization: WECHATPAY2-SHA256-RSA2048 mchid="1648526652",nonce_str="PqqUkBYXryat55bgyYeIzYzrGrfq3DDr",timestamp="1732880542",serial_no="2BF1B3D47E1631C774F4CBEDF0A55892EAF48BFA",signature="aIjuo3mfIyugNLvtFuboVpdFO5RnvZkTwKuO/hCcS0mnBjQkkxKDe1cO48xW/bWcQ26YxqTVVIp01fflmmR3QBtwkduElzqL5q+urKysT/hw7M9eS02vp7yUmpVU1++dxN4vFr1OXQYIFAK6/f4uFb2PWvlqrUUoD1vKV7h9DiXop1eLOM0X+JKa8q3wgNKzv3AjlN3/wGWzxVa/BEA1hnSQ+6nTet/8803/A/7gsMz5oM2GtXh9smbJRAtBKhpiZh8bHTzmHkxprgUmz9z05lBe42oEJMwG2KVQ/DqnpJnV5k6eUBq68EovPo39UbTjKoKpwLfE0vX0/KCLhSzkow==", Host: api.mch.weixin.qq.com, Connection: Keep-Alive, User-Agent: WechatPay-Apache-HttpClient/0.4.7 (Linux/3.10.0-1160.25.1.el7.x86_64) Java/1.8.0_382, Accept-Encoding: gzip,deflate]]
2024-11-29 19:42:23.076 ERROR 743 --- [           main] c.w.p.c.a.h.cert.CertificatesManager     : Auto update cert failed, statusCode = 401, body = {"code":"SIGN_ERROR","message":"Http头Authorization中的timestamp与发起请求的时间不得超过5分钟"}
2024-11-29 19:42:23.079 ERROR 743 --- [           main] cishan.main.common.config.AppConfig      : 下载平台证书返回状态码异常,状态码为:401
2024-11-29 19:42:23.080  WARN 743 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'payUtil' defined in URL [jar:file:/home/java/cishan/lib/cishan-main.jar!/BOOT-INF/classes!/cishan/main/utils/PayUtil.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'closeableHttpClient' defined in class path resource [cishan/main/common/config/AppConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.http.impl.client.CloseableHttpClient]: Factory method 'closeableHttpClient' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'certificatesManager' defined in class path resource [cishan/main/common/config/AppConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager]: Factory method 'certificatesManager' threw exception; nested exception is java.lang.RuntimeException: com.wechat.pay.contrib.apache.httpclient.exception.HttpCodeException: 下载平台证书返回状态码异常,状态码为:401

 

先看日志,问题是服务器的时间与真实时间有偏差.

在发起请求的时候微信会自己封装一个系统时间

服务器系统时间与实际实际相差5分钟或者5分钟以上就会出现这个错误

需要修改系统时间

离谱!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值