spring-boot dev_tools 自动重启 intelliJ IDEA mvn 如何重启应用

本文介绍Spring Boot DevTools模块的功能及实现原理,重点解释如何利用双ClassLoader机制实现快速重启,以及在IntelliJ IDEA环境下配合Maven进行代码修改后的自动重启。

今天试了spring-boot-devtool  环境是  mvn + intelliJ IDEA 然后发现怎么也无法重启,通过查看其原理:

spring-boot-devtools 是一个为开发者服务的一个模块,其中最重要的功能就是自动应用代码更改到最新的App上面去。原理是在发现代码有更改之后,重新启动应用,但是比速度比手动停止后再启动还要更快,更快指的不是节省出来的手工操作的时间。

其深层原理是使用了两个ClassLoader,一个Classloader加载那些不会改变的类(第三方Jar包),另一个ClassLoader加载会更改的类,称为  restart ClassLoader

,这样在有代码更改的时候,原来的restart ClassLoader 被丢弃,重新创建一个restart ClassLoader,由于需要加载的类相比较少,所以实现了较快的重启时间(5秒以内)。

发现必须是要编译源代码才能重启,然后测试点击mvn compile后自动重启生效。

转载于:https://www.cnblogs.com/steven3wang/p/6133909.html

D:\Environment\Java\jdk1.8\bin\java.exe -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:59709,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" -javaagent:C:\Users\WeiMu\AppData\Local\JetBrains\IntelliJIdea2024.1\captureAgent\debugger-agent.jar=file:/C:/Users/WeiMu/AppData/Local/Temp/capture.props -Dfile.encoding=UTF-8 -classpath "D:\Compiler-Tools\IntelliJ IDEA 2024.1\lib\idea_rt.jar" com.intellij.rt.execution.CommandLineWrapper C:\Users\WeiMu\AppData\Local\Temp\idea_classpath976186914 com.edms.netdisk.EdmsNetDiskApplication Connected to the target VM, address: '127.0.0.1:59709', transport: 'socket' . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.7.7) 2025-08-29 16:36:58.134 INFO 39024 --- [ main] com.alibaba.nacos.common.remote.client : [RpcClientFactory] create a new rpc client of 815a9e06-0878-48f8-87db-d969827e025c_config-0 2025-08-29 16:36:58.195 INFO 39024 --- [ main] org.reflections.Reflections : Reflections took 39 ms to scan 1 urls, producing 3 keys and 6 values 2025-08-29 16:36:58.228 INFO 39024 --- [ main] org.reflections.Reflections : Reflections took 14 ms to scan 1 urls, producing 4 keys and 9 values 2025-08-29 16:36:58.241 INFO 39024 --- [ main] org.reflections.Reflections : Reflections took 11 ms to scan 1 urls, producing 3 keys and 10 values 2025-08-29 16:36:58.593 INFO 39024 --- [ main] org.reflections.Reflections : Reflections took 348 ms to scan 457 urls, producing 0 keys and 0 values 2025-08-29 16:36:58.603 INFO 39024 --- [ main] org.reflections.Reflections : Reflections took 8 ms to scan 1 urls, producing 1 keys and 5 values 2025-08-29 16:36:58.617 INFO 39024 --- [ main] org.reflections.Reflections : Reflections took 12 ms to scan 1 urls, producing 1 keys and 7 values 2025-08-29 16:36:58.629 INFO 39024 --- [ main] org.reflections.Reflections : Reflections took 10 ms to scan 1 urls, producing 2 keys and 8 values 2025-08-29 16:36:58.904 INFO 39024 --- [ main] org.reflections.Reflections : Reflections took 273 ms to scan 457 urls, producing 0 keys and 0 values 2025-08-29 16:36:58.908 INFO 39024 --- [ main] com.alibaba.nacos.common.remote.client : [815a9e06-0878-48f8-87db-d969827e025c_config-0] RpcClient init label, labels = {module=config, Vipserver-Tag=null, source=sdk, Amory-Tag=null, Location-Tag=null, taskId=0, AppName=unknown} 2025-08-29 16:36:58.908 INFO 39024 --- [ main] com.alibaba.nacos.common.remote.client : [815a9e06-0878-48f8-87db-d969827e025c_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$369/1043584830 2025-08-29 16:36:58.908 INFO 39024 --- [ main] com.alibaba.nacos.common.remote.client : [815a9e06-0878-48f8-87db-d969827e025c_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$370/1770125555 2025-08-29 16:36:58.909 INFO 39024 --- [ main] com.alibaba.nacos.common.remote.client : [815a9e06-0878-48f8-87db-d969827e025c_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1 2025-08-29 16:36:58.909 INFO 39024 --- [ main] com.alibaba.nacos.common.remote.client : [815a9e06-0878-48f8-87db-d969827e025c_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2 2025-08-29 16:36:58.917 INFO 39024 --- [ main] com.alibaba.nacos.common.remote.client : [815a9e06-0878-48f8-87db-d969827e025c_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848} 2025-08-29 16:37:01.208 INFO 39024 --- [ main] com.alibaba.nacos.common.remote.client : [815a9e06-0878-48f8-87db-d969827e025c_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1756456621030_127.0.0.1_59786 2025-08-29 16:37:01.209 INFO 39024 --- [t.remote.worker] com.alibaba.nacos.common.remote.client : [815a9e06-0878-48f8-87db-d969827e025c_config-0] Notify connected event to listeners. 2025-08-29 16:37:01.209 INFO 39024 --- [ main] com.alibaba.nacos.common.remote.client : [815a9e06-0878-48f8-87db-d969827e025c_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler 2025-08-29 16:37:01.210 INFO 39024 --- [ main] com.alibaba.nacos.common.remote.client : [815a9e06-0878-48f8-87db-d969827e025c_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda$379/485701373 2025-08-29 16:37:01.278 WARN 39024 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[edms-netdisk] & group[DEFAULT_GROUP] 2025-08-29 16:37:01.281 WARN 39024 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[edms-netdisk.yml] & group[DEFAULT_GROUP] 2025-08-29 16:37:01.293 INFO 39024 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-edms-netdisk-dev.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-edms-netdisk.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-edms-netdisk,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-application-dev.yml,DEFAULT_GROUP'}] 2025-08-29 16:37:01.303 INFO 39024 --- [ main] com.edms.netdisk.EdmsNetDiskApplication : The following 1 profile is active: "dev" 2025-08-29 16:37:02.950 INFO 39024 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode 2025-08-29 16:37:02.953 INFO 39024 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode. 2025-08-29 16:37:02.986 INFO 39024 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 17 ms. Found 0 Redis repository interfaces. 2025-08-29 16:37:03.359 INFO 39024 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=5c5d8be8-c9b4-38b9-9f90-0a8c2bf02ce4 2025-08-29 16:37:03.462 INFO 39024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration' of type [org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-08-29 16:37:03.465 INFO 39024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-08-29 16:37:03.466 INFO 39024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'loadBalancerClientsDefaultsMappingsProvider' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration$$Lambda$516/1979080020] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-08-29 16:37:03.467 INFO 39024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'defaultsBindHandlerAdvisor' of type [org.springframework.cloud.commons.config.DefaultsBindHandlerAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-08-29 16:37:03.470 INFO 39024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'stringToNoneShardingStrategyConfigurationConverter' of type [org.apache.shardingsphere.spring.boot.converter.StringToNoneShardingStrategyConfigurationConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-08-29 16:37:03.475 INFO 39024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.shardingsphere-org.apache.shardingsphere.spring.boot.prop.SpringBootPropertiesConfiguration' of type [org.apache.shardingsphere.spring.boot.prop.SpringBootPropertiesConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-08-29 16:37:03.934 INFO 39024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shardingsphere.spring.boot.ShardingSphereAutoConfiguration' of type [org.apache.shardingsphere.spring.boot.ShardingSphereAutoConfiguration$$EnhancerBySpringCGLIB$$e4aed4a3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-08-29 16:37:04.143 INFO 39024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource.dynamic-com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-08-29 16:37:04.155 INFO 39024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration$$EnhancerBySpringCGLIB$$6223225b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-08-29 16:37:04.170 INFO 39024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dsProcessor' of type [com.baomidou.dynamic.datasource.processor.DsHeaderProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-08-29 16:37:04.665 INFO 39024 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9061 (http) 2025-08-29 16:37:04.679 INFO 39024 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2025-08-29 16:37:04.679 INFO 39024 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.70] 2025-08-29 16:37:04.976 INFO 39024 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2025-08-29 16:37:04.976 INFO 39024 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3635 ms 2025-08-29 16:37:05.138 WARN 39024 --- [ main] c.b.d.d.DynamicRoutingDataSource : dynamic-datasource initial loaded [0] datasource,Please add your primary datasource or check your configuration 2025-08-29 16:37:05.688 INFO 39024 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2025-08-29 16:37:07.378 INFO 39024 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2025-08-29 16:37:09.775 WARN 39024 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'diskCommonBatchInfoController': Unsatisfied dependency expressed through field 'diskCommonBatchInfoService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'diskCommonBatchInfoServiceImpl': Unsatisfied dependency expressed through field 'diskCommonBatchInfoMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'diskCommonBatchInfoMapper' defined in file [D:\ezsoft\projects\edms-cloud\edms-modules\edms-netdisk\target\classes\com\edms\netdisk\mapper\DiskCommonBatchInfoMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required 2025-08-29 16:37:09.775 INFO 39024 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2025-08-29 16:37:09.777 INFO 39024 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 2025-08-29 16:37:09.778 INFO 39024 --- [ main] c.b.d.d.DynamicRoutingDataSource : dynamic-datasource start closing .... 2025-08-29 16:37:09.778 INFO 39024 --- [ main] c.b.d.d.DynamicRoutingDataSource : dynamic-datasource all closed success,bye 2025-08-29 16:37:09.779 INFO 39024 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2025-08-29 16:37:09.784 WARN 39024 --- [ main] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [ShardingSphere-SchemaMetaDataLoaderEngine-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) java.lang.Thread.run(Thread.java:748) 2025-08-29 16:37:09.801 INFO 39024 --- [ main] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2025-08-29 16:37:09.839 ERROR 39024 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'diskCommonBatchInfoController': Unsatisfied dependency expressed through field 'diskCommonBatchInfoService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'diskCommonBatchInfoServiceImpl': Unsatisfied dependency expressed through field 'diskCommonBatchInfoMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'diskCommonBatchInfoMapper' defined in file [D:\ezsoft\projects\edms-cloud\edms-modules\edms-netdisk\target\classes\com\edms\netdisk\mapper\DiskCommonBatchInfoMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.24.jar:5.3.24] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.24.jar:5.3.24] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.7.jar:2.7.7] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) [spring-boot-2.7.7.jar:2.7.7] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) [spring-boot-2.7.7.jar:2.7.7] at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-2.7.7.jar:2.7.7] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) [spring-boot-2.7.7.jar:2.7.7] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) [spring-boot-2.7.7.jar:2.7.7] at com.edms.netdisk.EdmsNetDiskApplication.main(EdmsNetDiskApplication.java:19) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_202] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_202] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_202] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_202] at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:65) [idea_rt.jar:na] Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'diskCommonBatchInfoServiceImpl': Unsatisfied dependency expressed through field 'diskCommonBatchInfoMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'diskCommonBatchInfoMapper' defined in file [D:\ezsoft\projects\edms-cloud\edms-modules\edms-netdisk\target\classes\com\edms\netdisk\mapper\DiskCommonBatchInfoMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.24.jar:5.3.24] ... 25 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'diskCommonBatchInfoMapper' defined in file [D:\ezsoft\projects\edms-cloud\edms-modules\edms-netdisk\target\classes\com\edms\netdisk\mapper\DiskCommonBatchInfoMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.24.jar:5.3.24] ... 39 common frames omitted Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required at org.springframework.util.Assert.notNull(Assert.java:201) ~[spring-core-5.3.24.jar:5.3.24] at org.mybatis.spring.support.SqlSessionDaoSupport.checkDaoConfig(SqlSessionDaoSupport.java:122) ~[mybatis-spring-2.0.6.jar:2.0.6] at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:73) ~[mybatis-spring-2.0.6.jar:2.0.6] at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) ~[spring-tx-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.24.jar:5.3.24] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.24.jar:5.3.24] ... 49 common frames omitted 2025-08-29 16:37:09.840 WARN 39024 --- [ Thread-5] c.a.n.common.http.HttpClientBeanHolder : [HttpClientBeanHolder] Start destroying common HttpClient 2025-08-29 16:37:09.861 WARN 39024 --- [ Thread-12] c.a.nacos.common.notify.NotifyCenter : [NotifyCenter] Start destroying Publisher 2025-08-29 16:37:09.861 WARN 39024 --- [ Thread-12] c.a.nacos.common.notify.NotifyCenter : [NotifyCenter] Destruction of the end 2025-08-29 16:37:09.862 WARN 39024 --- [ Thread-5] c.a.n.common.http.HttpClientBeanHolder : [HttpClientBeanHolder] Destruction of the end Disconnected from the target VM, address: '127.0.0.1:59709', transport: 'socket' Process finished with exit code 1 这是什么错误
08-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值