From ff5a94b4febd8a7a42103bbd5aa490034ef163e9 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Wed, 22 Nov 2023 17:56:26 +0800 Subject: [PATCH] log-slf4j --- .gitignore | 1 + logs/web_debug.log | 0 logs/web_error.log | 287 ------------------ logs/web_info.log | 0 logs/web_warn.log | 14 - .../service/impl/UserAddressServiceImpl.java | 39 ++- src/main/resources/application-dev.yml | 1 + src/main/resources/logback-spring.xml | 168 +++++----- 8 files changed, 113 insertions(+), 397 deletions(-) delete mode 100644 logs/web_debug.log delete mode 100644 logs/web_error.log delete mode 100644 logs/web_info.log delete mode 100644 logs/web_warn.log diff --git a/.gitignore b/.gitignore index 4ccc0ab2..978d1092 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ buildNumber.properties # https://github.com/takari/maven-wrapper#usage-without-binary-jar .mvn/wrapper/maven-wrapper.jar /.idea/ +/logs/ /src/test/ peanut_book.iml weChatConfig.properties diff --git a/logs/web_debug.log b/logs/web_debug.log deleted file mode 100644 index e69de29b..00000000 diff --git a/logs/web_error.log b/logs/web_error.log deleted file mode 100644 index 5d992817..00000000 --- a/logs/web_error.log +++ /dev/null @@ -1,287 +0,0 @@ -2023-11-22 09:49:07.261 [main] ERROR org.springframework.boot.SpringApplication - Application run failed -org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.peanut.PeanutBookApplication]; nested exception is java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189) - at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) - at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) - at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) - at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) - at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) - at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) - at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) - at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) - at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) - at com.peanut.PeanutBookApplication.main(PeanutBookApplication.java:10) -Caused by: java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist - at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:199) - at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:159) - at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:110) - at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:81) - at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:67) - at org.springframework.core.io.support.ResourcePropertySource.(ResourcePropertySource.java:67) - at org.springframework.core.io.support.DefaultPropertySourceFactory.createPropertySource(DefaultPropertySourceFactory.java:37) - at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:463) - at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:280) - at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199) - at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:304) - at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175) - ... 13 common frames omitted -2023-11-22 09:51:55.068 [main] ERROR org.springframework.boot.SpringApplication - Application run failed -org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.peanut.PeanutBookApplication]; nested exception is java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189) - at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) - at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) - at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) - at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) - at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) - at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) - at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) - at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) - at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) - at com.peanut.PeanutBookApplication.main(PeanutBookApplication.java:10) -Caused by: java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist - at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:199) - at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:159) - at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:110) - at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:81) - at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:67) - at org.springframework.core.io.support.ResourcePropertySource.(ResourcePropertySource.java:67) - at org.springframework.core.io.support.DefaultPropertySourceFactory.createPropertySource(DefaultPropertySourceFactory.java:37) - at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:463) - at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:280) - at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199) - at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:304) - at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175) - ... 13 common frames omitted -2023-11-22 09:55:28.399 [main] ERROR org.springframework.boot.SpringApplication - Application run failed -org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.peanut.PeanutBookApplication]; nested exception is java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189) - at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) - at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) - at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) - at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) - at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) - at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) - at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) - at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) - at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) - at com.peanut.PeanutBookApplication.main(PeanutBookApplication.java:10) -Caused by: java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist - at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:199) - at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:159) - at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:110) - at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:81) - at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:67) - at org.springframework.core.io.support.ResourcePropertySource.(ResourcePropertySource.java:67) - at org.springframework.core.io.support.DefaultPropertySourceFactory.createPropertySource(DefaultPropertySourceFactory.java:37) - at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:463) - at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:280) - at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199) - at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:304) - at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175) - ... 13 common frames omitted -2023-11-22 10:00:13.978 [main] ERROR org.springframework.boot.SpringApplication - Application run failed -org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.peanut.PeanutBookApplication]; nested exception is java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189) - at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) - at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) - at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) - at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) - at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) - at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) - at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) - at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) - at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) - at com.peanut.PeanutBookApplication.main(PeanutBookApplication.java:10) -Caused by: java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist - at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:199) - at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:159) - at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:110) - at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:81) - at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:67) - at org.springframework.core.io.support.ResourcePropertySource.(ResourcePropertySource.java:67) - at org.springframework.core.io.support.DefaultPropertySourceFactory.createPropertySource(DefaultPropertySourceFactory.java:37) - at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:463) - at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:280) - at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199) - at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:304) - at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175) - ... 13 common frames omitted -2023-11-22 10:03:01.766 [main] ERROR org.springframework.boot.SpringApplication - Application run failed -org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.peanut.PeanutBookApplication]; nested exception is java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189) - at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) - at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) - at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) - at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) - at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) - at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) - at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) - at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) - at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) - at com.peanut.PeanutBookApplication.main(PeanutBookApplication.java:10) -Caused by: java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist - at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:199) - at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:159) - at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:110) - at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:81) - at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:67) - at org.springframework.core.io.support.ResourcePropertySource.(ResourcePropertySource.java:67) - at org.springframework.core.io.support.DefaultPropertySourceFactory.createPropertySource(DefaultPropertySourceFactory.java:37) - at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:463) - at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:280) - at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199) - at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:304) - at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) - at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175) - ... 13 common frames omitted -2023-11-22 10:12:09.195 [main] ERROR org.springframework.boot.SpringApplication - Application run failed -java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected: -ERROR in ch.qos.logback.core.joran.spi.Interpreter@187:39 - no applicable action for [appender-ref], current ElementPath is [[configuration][appender-ref]] -ERROR in ch.qos.logback.core.joran.spi.Interpreter@188:42 - no applicable action for [appender-ref], current ElementPath is [[configuration][appender-ref]] -ERROR in ch.qos.logback.core.joran.spi.Interpreter@189:41 - no applicable action for [appender-ref], current ElementPath is [[configuration][appender-ref]] -ERROR in ch.qos.logback.core.joran.spi.Interpreter@190:41 - no applicable action for [appender-ref], current ElementPath is [[configuration][appender-ref]] -ERROR in ch.qos.logback.core.joran.spi.Interpreter@191:42 - no applicable action for [appender-ref], current ElementPath is [[configuration][appender-ref]] - at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:328) - at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:282) - at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:240) - at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) - at java.util.ArrayList.forEach(ArrayList.java:1257) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:339) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:297) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) - at com.peanut.PeanutBookApplication.main(PeanutBookApplication.java:10) -Caused by: java.lang.IllegalStateException: Logback configuration error detected: -ERROR in ch.qos.logback.core.joran.spi.Interpreter@187:39 - no applicable action for [appender-ref], current ElementPath is [[configuration][appender-ref]] -ERROR in ch.qos.logback.core.joran.spi.Interpreter@188:42 - no applicable action for [appender-ref], current ElementPath is [[configuration][appender-ref]] -ERROR in ch.qos.logback.core.joran.spi.Interpreter@189:41 - no applicable action for [appender-ref], current ElementPath is [[configuration][appender-ref]] -ERROR in ch.qos.logback.core.joran.spi.Interpreter@190:41 - no applicable action for [appender-ref], current ElementPath is [[configuration][appender-ref]] -ERROR in ch.qos.logback.core.joran.spi.Interpreter@191:42 - no applicable action for [appender-ref], current ElementPath is [[configuration][appender-ref]] - at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179) - at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:80) - at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60) - at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132) - at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:313) - ... 18 common frames omitted -2023-11-22 10:57:36.645 [redisson-netty-4-26] ERROR i.n.u.concurrent.DefaultPromise.rejectedExecution - Failed to submit a listener notification task. Event loop shut down? -java.util.concurrent.RejectedExecutionException: event executor terminated - at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:923) - at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:350) - at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:343) - at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:825) - at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:815) - at io.netty.util.concurrent.DefaultPromise.safeExecute(DefaultPromise.java:841) - at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:499) - at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) - at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:605) - at io.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:96) - at io.netty.channel.group.DefaultChannelGroupFuture.setSuccess0(DefaultChannelGroupFuture.java:200) - at io.netty.channel.group.DefaultChannelGroupFuture.access$400(DefaultChannelGroupFuture.java:41) - at io.netty.channel.group.DefaultChannelGroupFuture$1.operationComplete(DefaultChannelGroupFuture.java:75) - at io.netty.channel.group.DefaultChannelGroupFuture$1.operationComplete(DefaultChannelGroupFuture.java:48) - at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) - at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571) - at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550) - at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) - at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) - at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:605) - at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104) - at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) - at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1164) - at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:755) - at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:731) - at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:620) - at io.netty.channel.nio.NioEventLoop.closeAll(NioEventLoop.java:772) - at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:529) - at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) - 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:748) -2023-11-22 10:58:14.506 [main] ERROR org.springframework.boot.SpringApplication - Application run failed -org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getVerifier' defined in class path resource [com/peanut/modules/pay/weChatPay/config/WechatPayConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.wechat.pay.contrib.apache.httpclient.auth.Verifier]: Factory method 'getVerifier' threw exception; nested exception is java.lang.RuntimeException: 私钥文件不存在 - at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) - at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) - 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:953) - at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) - at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) - at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) - at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) - at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) - at com.peanut.PeanutBookApplication.main(PeanutBookApplication.java:10) -Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.wechat.pay.contrib.apache.httpclient.auth.Verifier]: Factory method 'getVerifier' threw exception; nested exception is java.lang.RuntimeException: 私钥文件不存在 - 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: java.lang.RuntimeException: 私钥文件不存在 - at com.peanut.modules.pay.weChatPay.config.WechatPayConfig.getPrivateKey(WechatPayConfig.java:103) - at com.peanut.modules.pay.weChatPay.config.WechatPayConfig.getVerifier(WechatPayConfig.java:119) - at com.peanut.modules.pay.weChatPay.config.WechatPayConfig$$EnhancerBySpringCGLIB$$2a7c2a41.CGLIB$getVerifier$21() - at com.peanut.modules.pay.weChatPay.config.WechatPayConfig$$EnhancerBySpringCGLIB$$2a7c2a41$$FastClassBySpringCGLIB$$75c5f8af.invoke() - at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) - at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) - at com.peanut.modules.pay.weChatPay.config.WechatPayConfig$$EnhancerBySpringCGLIB$$2a7c2a41.getVerifier() - 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.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) - ... 20 common frames omitted -Caused by: java.io.FileNotFoundException: D:\usr\local\hs\peanut_book\target\classes\cent\apiclient_key.pem (系统找不到指定的路径。) - at java.io.FileInputStream.open0(Native Method) - at java.io.FileInputStream.open(FileInputStream.java:195) - at java.io.FileInputStream.(FileInputStream.java:138) - at java.io.FileInputStream.(FileInputStream.java:93) - at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) - at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) - at java.net.URL.openStream(URL.java:1045) - at com.peanut.modules.pay.weChatPay.config.WechatPayConfig.getPrivateKey(WechatPayConfig.java:101) - ... 31 common frames omitted diff --git a/logs/web_info.log b/logs/web_info.log deleted file mode 100644 index e69de29b..00000000 diff --git a/logs/web_warn.log b/logs/web_warn.log deleted file mode 100644 index baa5f829..00000000 --- a/logs/web_warn.log +++ /dev/null @@ -1,14 +0,0 @@ -2023-11-22 09:44:31.460 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning -2023-11-22 09:49:07.239 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.peanut.PeanutBookApplication]; nested exception is java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist -2023-11-22 09:51:55.042 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.peanut.PeanutBookApplication]; nested exception is java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist -2023-11-22 09:55:28.378 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.peanut.PeanutBookApplication]; nested exception is java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist -2023-11-22 10:00:13.956 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.peanut.PeanutBookApplication]; nested exception is java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist -2023-11-22 10:03:01.740 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.peanut.PeanutBookApplication]; nested exception is java.io.FileNotFoundException: class path resource [weChatConfig.properties] cannot be opened because it does not exist -2023-11-22 10:06:08.124 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning -2023-11-22 10:07:02.212 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning -2023-11-22 10:13:47.283 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning -2023-11-22 10:15:07.132 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning -2023-11-22 10:17:26.743 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning -2023-11-22 10:58:13.733 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning -2023-11-22 10:58:14.417 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getVerifier' defined in class path resource [com/peanut/modules/pay/weChatPay/config/WechatPayConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.wechat.pay.contrib.apache.httpclient.auth.Verifier]: Factory method 'getVerifier' threw exception; nested exception is java.lang.RuntimeException: 私钥文件不存在 -2023-11-22 10:58:56.678 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning diff --git a/src/main/java/com/peanut/modules/book/service/impl/UserAddressServiceImpl.java b/src/main/java/com/peanut/modules/book/service/impl/UserAddressServiceImpl.java index 469cfb01..8ccf561a 100644 --- a/src/main/java/com/peanut/modules/book/service/impl/UserAddressServiceImpl.java +++ b/src/main/java/com/peanut/modules/book/service/impl/UserAddressServiceImpl.java @@ -1,5 +1,6 @@ package com.peanut.modules.book.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.peanut.modules.book.entity.City; import com.peanut.modules.book.entity.County; import com.peanut.modules.book.entity.Province; @@ -53,21 +54,31 @@ public class UserAddressServiceImpl extends ServiceImpl cityQueryWrapper = new QueryWrapper<>(); - cityQueryWrapper.eq("region_code", cityRegionCode); - City city = cityService.getOne(cityQueryWrapper); + LambdaQueryWrapper cityLambdaQueryWrapper = new LambdaQueryWrapper<>(); + cityLambdaQueryWrapper.eq(City::getCityId,county.getCityId()); + City city = cityService.getOne(cityLambdaQueryWrapper); vo.setCity(city.getCityName()); - String provinceRegionCode = regionCode.substring(0, 2).concat("0000"); - QueryWrapper provinceQueryWrapper = new QueryWrapper<>(); - provinceQueryWrapper.eq("region_code", provinceRegionCode); - Province province = provinceService.getOne(provinceQueryWrapper); - vo.setProvince(province.getProvName()); + LambdaQueryWrapper provinceLambdaQueryWrapper = new LambdaQueryWrapper<>(); + provinceLambdaQueryWrapper.eq(Province::getProvId,city.getProvId()); + Province province = provinceService.getOne(provinceLambdaQueryWrapper); + vo.setProvince((province.getProvName())); + +// String cityRegionCode; +// if (regionCode.startsWith("11") || regionCode.startsWith("12") || regionCode.startsWith("31") || regionCode.startsWith("50")) { +// cityRegionCode = regionCode.substring(0, 2).concat("0000"); +// } else { +// cityRegionCode = regionCode.substring(0, 4).concat("00"); +// } +// QueryWrapper cityQueryWrapper = new QueryWrapper<>(); +// System.out.println(cityRegionCode); +// cityQueryWrapper.eq("region_code", cityRegionCode); +// City city = cityService.getOne(cityQueryWrapper); +// vo.setCity(city.getCityName()); +// String provinceRegionCode = regionCode.substring(0, 2).concat("0000"); +// QueryWrapper provinceQueryWrapper = new QueryWrapper<>(); +// provinceQueryWrapper.eq("region_code", provinceRegionCode); +// Province province = provinceService.getOne(provinceQueryWrapper); +// vo.setProvince(province.getProvName()); return vo; } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 043f5123..d71070c0 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -74,6 +74,7 @@ aliyun: server: port: 9200 + wxpay: appId: wx47134a8f15083734 mchId: 1612860909 diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 42688217..5d70cf83 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -1,40 +1,44 @@ - - - + + + + - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + + - + - - - - - - - + + + + + + + - + @@ -47,8 +51,6 @@ - - ${log.path}/web_debug.log @@ -75,7 +77,7 @@ - + ${log.path}/web_info.log @@ -102,7 +104,7 @@ - + ${log.path}/web_warn.log @@ -128,7 +130,7 @@ - + ${log.path}/web_error.log @@ -154,59 +156,61 @@ - + + + + + + + + + + + + - + + + + + + - + + + + + + - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + \ No newline at end of file