微信支付配置报错
来源:10-18 微信支付3.0的资质和Java依赖库

好好学习__yeah
2023-12-09
老师我的微信支付密钥是和文档一样的,PayConfig.class也有,(https://img1.sycdn.imooc.com/szimg/65736d9308fd3dfe26221216.jpg)到底是哪里有问题我要改哪里呢?在配置微信支付之前都是正常可运行的。
报错信息:
2023/12/08 11:19:10 INFO Starting HisApiApplication using Java 15.0.2 on MacBook-Air.local with PID 38448 (/Users/Documents/IdeaProject/his-api/target/classes started in /Users/Documents/IdeaProject/his-api)
2023/12/08 11:19:10 INFO No active profile set, falling back to 1 default profile: "default"
2023/12/08 11:19:11 INFO Multiple Spring Data modules found, entering strict repository configuration mode
2023/12/08 11:19:11 INFO Bootstrapping Spring Data MongoDB repositories in DEFAULT mode.
2023/12/08 11:19:11 INFO Finished Spring Data repository scanning in 22 ms. Found 0 MongoDB repository interfaces.
2023/12/08 11:19:11 INFO Multiple Spring Data modules found, entering strict repository configuration mode
2023/12/08 11:19:11 INFO Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023/12/08 11:19:11 INFO Finished Spring Data repository scanning in 4 ms. Found 0 Redis repository interfaces.
2023/12/08 11:19:12 INFO Logging initialized @3452ms to org.eclipse.jetty.util.log.Slf4jLog
2023/12/08 11:19:12 INFO Server initialized with port: 7700
2023/12/08 11:19:12 INFO jetty-9.4.51.v20230217; built: 2023-02-17T08:19:37.309Z; git: b45c405e4544384de066f814ed42ae3dceacdd49; jvm 15.0.2+7-27
2023/12/08 11:19:12 INFO Initializing Spring embedded WebApplicationContext
2023/12/08 11:19:12 INFO Root WebApplicationContext: initialization completed in 1938 ms
2023/12/08 11:19:12 INFO DefaultSessionIdManager workerName=node0
2023/12/08 11:19:12 INFO No SessionScavenger set, using defaults
2023/12/08 11:19:12 INFO node0 Scavenging every 660000ms
2023/12/08 11:19:12 INFO Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@7b9088f2{application,/his-api,[file:///private/var/folders/56/ggnqv9rd5m702zmv23my03xh0000gn/T/jetty-docbase.7700.8360762693941382168/],AVAILABLE}
2023/12/08 11:19:12 INFO Started @3790ms
Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter.
2023/12/08 11:19:13 INFO Init DruidDataSource
2023/12/08 11:19:27 INFO {dataSource-1} inited
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/ActionDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/AppointmentDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/AppointmentRestrictionDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/CheckupReportDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/CustomerDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/CustomerImDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/CustomerLocationDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/DeptDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/FlowRegulationDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/GoodsDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/ModuleDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/OrderDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/PermissionDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/RoleDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/RuleDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/SystemDao.xml]'
Parsed mapper file: 'file [/Users/Documents/IdeaProject/his-api/target/classes/mapper/UserDao.xml]'
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6fe6c0e4] was not registered for synchronization because synchronization is not active
JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@7fe1a49c] will not be managed by Spring
==> Preparing: SELECT id, item, `value` FROM tb_system
==> Parameters:
<== Columns: id, item, value
<== Row: 1, appointment_number, 200
<== Row: 2, auto_flow regulation, false
<== Total: 2
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6fe6c0e4]
2023/12/08 11:19:28 INFO MongoClient with metadata {"driver": {"name": "mongo-java-driver|sync|spring-boot", "version": "4.6.1"}, "os": {"type": "Darwin", "name": "Mac OS X", "architecture": "x86_64", "version": "10.16"}, "platform": "Java/Oracle Corporation/15.0.2+7-27"} created with settings MongoClientSettings{readPreference=primary, writeConcern=WriteConcern{w=null, wTimeout=null ms, journal=null}, retryWrites=true, retryReads=true, readConcern=ReadConcern{level=null}, credential=MongoCredential{mechanism=null, userName='admin', source='admin', password=<hidden>, mechanismProperties=<hidden>}, streamFactoryFactory=null, commandListeners=[], codecRegistry=ProvidersCodecRegistry{codecProviders=[ValueCodecProvider{}, BsonValueCodecProvider{}, DBRefCodecProvider{}, DBObjectCodecProvider{}, DocumentCodecProvider{}, IterableCodecProvider{}, MapCodecProvider{}, GeoJsonCodecProvider{}, GridFSFileCodecProvider{}, Jsr310CodecProvider{}, JsonObjectCodecProvider{}, BsonCodecProvider{}, EnumCodecProvider{}, com.mongodb.Jep395RecordCodecProvider@37b80ec7]}, clusterSettings={hosts=[43.140.221.188:27017], srvServiceName=mongodb, mode=SINGLE, requiredClusterType=UNKNOWN, requiredReplicaSetName='null', serverSelector='null', clusterListeners='[]', serverSelectionTimeout='30000 ms', localThreshold='30000 ms'}, socketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=0, receiveBufferSize=0, sendBufferSize=0}, heartbeatSocketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=10000, receiveBufferSize=0, sendBufferSize=0}, connectionPoolSettings=ConnectionPoolSettings{maxSize=100, minSize=0, maxWaitTimeMS=120000, maxConnectionLifeTimeMS=0, maxConnectionIdleTimeMS=0, maintenanceInitialDelayMS=0, maintenanceFrequencyMS=60000, connectionPoolListeners=[], maxConnecting=2}, serverSettings=ServerSettings{heartbeatFrequencyMS=10000, minHeartbeatFrequencyMS=500, serverListeners='[]', serverMonitorListeners='[]'}, sslSettings=SslSettings{enabled=false, invalidHostNameAllowed=false, context=null}, applicationName='null', compressorList=[], uuidRepresentation=JAVA_LEGACY, serverApi=null, autoEncryptionSettings=null, contextProvider=null}
2023/12/08 11:19:29 INFO Opened connection [connectionId{localValue:2, serverValue:169}] to 43.140.221.188:27017
2023/12/08 11:19:29 INFO Opened connection [connectionId{localValue:1, serverValue:170}] to 43.140.221.188:27017
2023/12/08 11:19:29 INFO Monitor thread successfully connected to server with description ServerDescription{address=43.140.221.188:27017, type=STANDALONE, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=260869625}
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@684fea48] was not registered for synchronization because synchronization is not active
JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@7fe1a49c] will not be managed by Spring
==> Preparing: SELECT date, num_1, num_2, num_3 FROM tb_appointment_restriction WHERE date BETWEEN ? AND ?
==> Parameters: 2023-12-09(String), 2024-02-07(String)
<== Total: 0
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@684fea48]
2023/12/08 11:19:30 WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'signatureProvider' defined in class path resource [cn/felord/payment/wechat/WechatPayConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [cn.felord.payment.wechat.v3.SignatureProvider]: Factory method 'signatureProvider' threw exception; nested exception is org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized: "{"code":"SIGN_ERROR","message":"Http头Authorization中的timestamp与发起请求的时间不得超过5分钟"}"
2023/12/08 11:19:30 INFO {dataSource-1} closing ...
2023/12/08 11:19:30 INFO {dataSource-1} closed
2023/12/08 11:19:30 ERROR Unexpected exception occurred invoking async method: public void com.example.his.api.async.InitializeWorkAsync.init()
org.springframework.data.redis.RedisSystemException: Redis command interrupted; nested exception is io.lettuce.core.RedisCommandInterruptedException: Command interrupted
at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:62)
at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41)
at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44)
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42)
at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:277)
at org.springframework.data.redis.connection.lettuce.LettuceConnection.await(LettuceConnection.java:1085)
at org.springframework.data.redis.connection.lettuce.LettuceConnection.lambda$doInvoke$4(LettuceConnection.java:938)
at org.springframework.data.redis.connection.lettuce.LettuceInvoker$Synchronizer.invoke(LettuceInvoker.java:665)
at org.springframework.data.redis.connection.lettuce.LettuceInvoker.just(LettuceInvoker.java:109)
at org.springframework.data.redis.connection.lettuce.LettuceKeyCommands.expireAt(LettuceKeyCommands.java:274)
at org.springframework.data.redis.connection.DefaultedRedisConnection.expireAt(DefaultedRedisConnection.java:214)
at org.springframework.data.redis.core.RedisTemplate.lambda$expireAt$10(RedisTemplate.java:831)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:191)
at org.springframework.data.redis.core.RedisTemplate.expireAt(RedisTemplate.java:827)
at com.example.his.api.async.InitializeWorkAsync.lambda$createAppointmentCache$1(InitializeWorkAsync.java:79)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at com.example.his.api.async.InitializeWorkAsync.createAppointmentCache(InitializeWorkAsync.java:60)
at com.example.his.api.async.InitializeWorkAsync.init(InitializeWorkAsync.java:38)
at com.example.his.api.async.InitializeWorkAsync$$FastClassBySpringCGLIB$$cf5a9c8.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: io.lettuce.core.RedisCommandInterruptedException: Command interrupted
at io.lettuce.core.protocol.AsyncCommand.await(AsyncCommand.java:87)
at io.lettuce.core.internal.Futures.awaitOrCancel(Futures.java:244)
at io.lettuce.core.LettuceFutures.awaitOrCancel(LettuceFutures.java:74)
at org.springframework.data.redis.connection.lettuce.LettuceConnection.await(LettuceConnection.java:1083)
... 23 common frames omitted
Caused by: java.lang.InterruptedException: null
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:385)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2086)
at io.lettuce.core.protocol.AsyncCommand.await(AsyncCommand.java:83)
... 26 common frames omitted
2023/12/08 11:19:30 INFO node0 Stopped scavenging
2023/12/08 11:19:30 INFO Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@7b9088f2{application,/his-api,[file:///private/var/folders/56/ggnqv9rd5m702zmv23my03xh0000gn/T/jetty-docbase.7700.8360762693941382168/],STOPPED}
2023/12/08 11:19:30 INFO
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023/12/08 11:19:30 ERROR Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'signatureProvider' defined in class path resource [cn/felord/payment/wechat/WechatPayConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [cn.felord.payment.wechat.v3.SignatureProvider]: Factory method 'signatureProvider' threw exception; nested exception is org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized: "{"code":"SIGN_ERROR","message":"Http头Authorization中的timestamp与发起请求的时间不得超过5分钟"}"
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
at com.example.his.api.HisApiApplication.main(HisApiApplication.java:28)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [cn.felord.payment.wechat.v3.SignatureProvider]: Factory method 'signatureProvider' threw exception; nested exception is org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized: "{"code":"SIGN_ERROR","message":"Http头Authorization中的timestamp与发起请求的时间不得超过5分钟"}"
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 19 common frames omitted
Caused by: org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized: "{"code":"SIGN_ERROR","message":"Http头Authorization中的timestamp与发起请求的时间不得超过5分钟"}"
at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:105)
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:168)
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:122)
at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:825)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:783)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:666)
at cn.felord.payment.wechat.v3.SignatureProvider.refreshCertificate(SignatureProvider.java:230)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at cn.felord.payment.wechat.v3.SignatureProvider.<init>(SignatureProvider.java:129)
at cn.felord.payment.wechat.WechatPayConfiguration.signatureProvider(WechatPayConfiguration.java:85)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 20 common frames omitted
Process finished with exit code 1
1回答
-
神思者
2023-12-09
微信支付信息没有配置完全,所有东西都要配置,不存在暂时不配置的东西
012023-12-09
相似问题