aizuda/snail-job

关于EasyRetryServer启动问题

Closed this issue · 2 comments

只修改了配置文件的端口8080->18080,同时数据库Mysql也已经初始化sql脚本了,但是启动报错了。
. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
' |
| .__|| ||| |_, | / / / /
=========|
|==============|/=////
:: Spring Boot :: (v2.6.8)

2023-08-13 15:21:04.195 [main] INFO com.aizuda.easy.retry.server.EasyRetryServerApplication - Starting EasyRetryServerApplication using Java 1.8.0_261 on 2110NB8145 with PID 80088 (D:\easy-retry\easy-retry\easy-retry-server\target\classes started by admin in D:\easy-retry\easy-retry)
2023-08-13 15:21:04.193 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 6.2.3.Final
2023-08-13 15:21:04.196 [main] INFO com.aizuda.easy.retry.server.EasyRetryServerApplication - The following 1 profile is active: "dev"
2023-08-13 15:21:05.688 [main] INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 18080 (http)
2023-08-13 15:21:05.707 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-18080"]
2023-08-13 15:21:05.708 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2023-08-13 15:21:05.709 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.63]
2023-08-13 15:21:05.919 [main] INFO org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2023-08-13 15:21:05.919 [main] INFO org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1657 ms
_ _ |_ _ |. ___ _ | _
| | |/|)(| | |\ |)|||\
/ |
3.5.3.1
2023-08-13 15:21:10.531 [DISPATCH_RETRY_ACTOR_SYSTEM-akka.actor.default-dispatcher-6] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2023-08-13 15:21:10.638 [DISPATCH_EXEC_UNIT_RETRY_ACTOR_SYSTEM-akka.actor.default-dispatcher-6] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2023-08-13 15:21:10.660 [DISPATCH_RESULT_ACTOR_SYSTEM-akka.actor.default-dispatcher-6] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2023-08-13 15:21:10.679 [LOG_ACTOR_SYSTEM-akka.actor.default-dispatcher-5] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2023-08-13 15:21:10.697 [NETTY_ACTOR_SYSTEM-akka.actor.default-dispatcher-7] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2023-08-13 15:21:10.951 [main] INFO org.springframework.boot.autoconfigure.web.servlet.WelcomePageHandlerMapping - Adding welcome page: class path resource [admin/index.html]
2023-08-13 15:21:11.093 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-18080"]
2023-08-13 15:21:11.114 [main] INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 18080 (http) with context path ''


| | _ ____ _ | _ _| |_ _ _ _ _
| |/ ` (-< || | | / -) | '| || |
|
_,/__/_, | ||___|_|_| _, |
|/ |/
:: Easy Retry :: (vnull)

2023-08-13 15:21:11.123 [main] INFO com.aizuda.easy.retry.server.support.listener.StartListener - easy-retry-server vnull starting...
2023-08-13 15:21:11.124 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheLockRecord - CacheLockRecord start
2023-08-13 15:21:11.138 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheConsumerGroup - CacheRegisterTable start
2023-08-13 15:21:11.138 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheGroup - CacheGroup start
2023-08-13 15:21:11.138 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheGroupRateLimiter - CacheGroupRateLimiter start
2023-08-13 15:21:11.138 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheGroupScanActor - CacheGroupScanActor start
2023-08-13 15:21:11.138 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheRegisterTable - CacheRegisterTable start
2023-08-13 15:21:11.139 [main] INFO com.aizuda.easy.retry.server.support.generator.id.SegmentIdGenerator - SegmentIdGenerator start
2023-08-13 15:21:11.139 [main] INFO com.aizuda.easy.retry.server.support.generator.id.SegmentIdGenerator - update cache from db
2023-08-13 15:21:11.380 [main] INFO com.zaxxer.hikari.HikariDataSource - easy_retry - Starting...
2023-08-13 15:21:11.555 [main] INFO com.zaxxer.hikari.HikariDataSource - easy_retry - Start completed.
2023-08-13 15:21:11.580 [main] INFO org.perf4j.TimingLogger - start[1691911271141] time[438] tag[updateCacheFromDb]
2023-08-13 15:21:11.581 [main] INFO com.aizuda.easy.retry.server.support.generator.id.SegmentIdGenerator - SegmentIdGenerator start end
2023-08-13 15:21:11.581 [main] INFO com.aizuda.easy.retry.server.support.handler.ServerNodeBalance - ServerNodeBalance start
2023-08-13 15:21:11.581 [main] INFO com.aizuda.easy.retry.server.support.register.ServerRegister - ServerRegister start
2023-08-13 15:21:11.586 [main] INFO com.aizuda.easy.retry.server.support.listener.StartListener - easy-retry-server vnull start completed
2023-08-13 15:21:11.596 [main] INFO com.aizuda.easy.retry.server.EasyRetryServerApplication - Started EasyRetryServerApplication in 8.173 seconds (JVM running for 9.496)
2023-08-13 15:21:11.607 [main] INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 18080 (http)
2023-08-13 15:21:11.608 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-18080"]
2023-08-13 15:21:11.608 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2023-08-13 15:21:11.608 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.63]
2023-08-13 15:21:11.637 [main] INFO org.apache.catalina.core.StandardService - Stopping service [Tomcat]
2023-08-13 15:21:11.676 [easy-retry-scheduled-thread-2] WARN com.aizuda.easy.retry.server.persistence.support.access.lock.JdbcLockAccess - Duplicate key. lockName:[clearOfflineNode]
2023-08-13 15:21:11.676 [easy-retry-scheduled-thread-1] WARN com.aizuda.easy.retry.server.persistence.support.access.lock.JdbcLockAccess - Duplicate key. lockName:[clearLog]

. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
' |
| .__|| ||| |_, | / / / /
=========|
|==============|/=////
:: Spring Boot :: (v2.6.8)

2023-08-13 15:21:11.687 [server-register-node] WARN com.aizuda.easy.retry.server.support.cache.CacheRegisterTable - node not exists. groupName:[DEFAULT_SERVER] hostId:[1690624517878145024]
2023-08-13 15:21:11.692 [main] INFO com.aizuda.easy.retry.server.EasyRetryServerApplication - Starting EasyRetryServerApplication using Java 1.8.0_261 on 2110NB8145 with PID 80088 (D:\easy-retry\easy-retry\easy-retry-server\target\classes started by admin in D:\easy-retry\easy-retry)
2023-08-13 15:21:11.693 [main] INFO com.aizuda.easy.retry.server.EasyRetryServerApplication - The following 1 profile is active: "dev"
2023-08-13 15:21:11.715 [easy-retry-scheduled-thread-2] WARN com.aizuda.easy.retry.server.persistence.support.access.lock.JdbcLockAccess - Duplicate key. lockName:[retryErrorMoreThreshold]
2023-08-13 15:21:11.720 [easy-retry-scheduled-thread-2] INFO com.aizuda.easy.retry.server.support.schedule.RetryErrorMoreThresholdAlarmSchedule - retryErrorMoreThreshold time[2023-08-13T15:21:11.720] ip:[2.0.1.71]
2023-08-13 15:21:11.726 [easy-retry-scheduled-thread-1] WARN com.aizuda.easy.retry.server.persistence.support.access.lock.JdbcLockAccess - Duplicate key. lockName:[retryTaskMoreThreshold]
2023-08-13 15:21:11.733 [easy-retry-scheduled-thread-1] INFO com.aizuda.easy.retry.server.support.schedule.RetryTaskMoreThresholdAlarmSchedule - retryTaskMoreThreshold time[2023-08-13T15:21:11.733] ip:[2.0.1.71]
2023-08-13 15:21:11.737 [easy-retry-scheduled-thread-2] WARN com.aizuda.easy.retry.server.persistence.support.access.lock.JdbcLockAccess - Duplicate key. lockName:[clearFinishAndMoveDeadLetterRetryTask]
2023-08-13 15:21:12.043 [main] INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 18080 (http)
2023-08-13 15:21:12.044 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-18080"]
2023-08-13 15:21:12.045 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
2023-08-13 15:21:12.045 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.63]
2023-08-13 15:21:12.065 [main] INFO org.apache.catalina.core.ContainerBase.[Tomcat-2].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2023-08-13 15:21:12.065 [main] INFO org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 367 ms
2023-08-13 15:21:12.568 [Thread-19] INFO com.aizuda.easy.retry.server.server.NettyHttpServer - ------> easy-retry remoting server start success, nettype = com.aizuda.easy.retry.server.server.NettyHttpServer, port = 1788
_ _ |_ _ |. ___ _ | _
| | |/|)(| | |\ |)|||\
/ |
3.5.3.1
2023-08-13 15:21:12.908 [DISPATCH_RETRY_ACTOR_SYSTEM-akka.actor.default-dispatcher-7] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2023-08-13 15:21:12.931 [DISPATCH_EXEC_UNIT_RETRY_ACTOR_SYSTEM-akka.actor.default-dispatcher-7] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2023-08-13 15:21:12.967 [DISPATCH_RESULT_ACTOR_SYSTEM-akka.actor.default-dispatcher-7] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2023-08-13 15:21:12.985 [LOG_ACTOR_SYSTEM-akka.actor.default-dispatcher-7] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2023-08-13 15:21:13.002 [NETTY_ACTOR_SYSTEM-akka.actor.default-dispatcher-5] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2023-08-13 15:21:13.069 [main] INFO org.springframework.boot.autoconfigure.web.servlet.WelcomePageHandlerMapping - Adding welcome page: class path resource [admin/index.html]
2023-08-13 15:21:13.086 [main] WARN org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springApplicationAdminRegistrar' defined in class path resource [org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Admin,name=SpringApplication
2023-08-13 15:21:13.090 [main] INFO org.apache.catalina.core.StandardService - Stopping service [Tomcat]
2023-08-13 15:21:13.095 [main] INFO org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener -

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-08-13 15:21:13.119 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springApplicationAdminRegistrar' defined in class path resource [org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Admin,name=SpringApplication
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
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:745)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at com.aizuda.easy.retry.server.EasyRetryServerApplication.lambda$nettyStartupChecker$0(EasyRetryServerApplication.java:40)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:773)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:763)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at com.aizuda.easy.retry.server.EasyRetryServerApplication.main(EasyRetryServerApplication.java:31)
Caused by: javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Admin,name=SpringApplication
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
at org.springframework.boot.admin.SpringApplicationAdminMXBeanRegistrar.afterPropertiesSet(SpringApplicationAdminMXBeanRegistrar.java:129)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
... 22 common frames omitted
2023-08-13 15:21:13.122 [main] INFO org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener -

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-08-13 15:21:13.123 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Failed to execute ApplicationRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:776)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:763)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at com.aizuda.easy.retry.server.EasyRetryServerApplication.main(EasyRetryServerApplication.java:31)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springApplicationAdminRegistrar' defined in class path resource [org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Admin,name=SpringApplication
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
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:745)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at com.aizuda.easy.retry.server.EasyRetryServerApplication.lambda$nettyStartupChecker$0(EasyRetryServerApplication.java:40)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:773)
... 5 common frames omitted
Caused by: javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Admin,name=SpringApplication
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
at org.springframework.boot.admin.SpringApplicationAdminMXBeanRegistrar.afterPropertiesSet(SpringApplicationAdminMXBeanRegistrar.java:129)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
... 22 common frames omitted
2023-08-13 15:21:13.124 [main] INFO com.aizuda.easy.retry.server.support.listener.EndListener - EASY-RETRY-SERVER 停止
2023-08-13 15:21:13.124 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheConsumerGroup - CacheRegisterTable stop
2023-08-13 15:21:13.124 [Thread-19] INFO com.aizuda.easy.retry.server.server.NettyHttpServer - --------> easy-retry remoting server stop.
2023-08-13 15:21:13.124 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheGroup - CacheGroup stop
2023-08-13 15:21:13.124 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheGroupRateLimiter - CacheGroupRateLimiter stop
2023-08-13 15:21:13.124 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheGroupScanActor - CacheGroupScanActor stop
2023-08-13 15:21:13.124 [main] INFO com.aizuda.easy.retry.server.support.cache.CacheRegisterTable - CacheRegisterTable stop
2023-08-13 15:21:13.124 [main] INFO com.aizuda.easy.retry.server.support.generator.id.SegmentIdGenerator - SegmentIdGenerator close
2023-08-13 15:21:13.125 [main] INFO com.aizuda.easy.retry.server.support.handler.ServerNodeBalance - ServerNodeBalance start.
2023-08-13 15:21:13.125 [config-version-sync] INFO com.aizuda.easy.retry.server.support.handler.ConfigVersionSyncHandler - [config-version-sync] thread stop.
2023-08-13 15:21:13.135 [main] INFO com.aizuda.easy.retry.server.support.handler.ServerNodeBalance - delete node success. [1690624517878145024]
2023-08-13 15:21:13.135 [main] INFO com.aizuda.easy.retry.server.support.handler.ServerNodeBalance - ServerNodeBalance close complete
2023-08-13 15:21:13.135 [main] INFO com.aizuda.easy.retry.server.support.register.ServerRegister - ServerRegister close
2023-08-13 15:21:13.135 [client-register] INFO com.aizuda.easy.retry.server.support.register.ClientRegister - [client-register] thread stop.
2023-08-13 15:21:13.569 [main] INFO com.zaxxer.hikari.HikariDataSource - easy_retry - Shutdown initiated...
2023-08-13 15:21:13.576 [main] INFO com.zaxxer.hikari.HikariDataSource - easy_retry - Shutdown completed.
2023-08-13 15:21:21.155 [DispatchService] INFO com.aizuda.easy.retry.server.support.dispatch.DispatchService - 当前分配的组:[[]]
2023-08-13 15:21:26.597 [server-register-node] ERROR com.aizuda.easy.retry.server.support.register.AbstractRegister - 注册节点失败 groupName:[DEFAULT_SERVER] hostIp:[2.0.1.71]
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (easy_retry) has been closed.

The error may exist in file [D:\easy-retry\easy-retry\easy-retry-server\target\classes\mapper\ServerNodeMapper.xml]

The error may involve com.aizuda.easy.retry.server.persistence.mybatis.mapper.ServerNodeMapper.insertOrUpdate

The error occurred while executing an update

Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (easy_retry) has been closed.

at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:96)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
at com.sun.proxy.$Proxy70.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:59)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy81.insertOrUpdate(Unknown Source)
at com.aizuda.easy.retry.server.support.register.AbstractRegister.refreshExpireAt(AbstractRegister.java:38)
at com.aizuda.easy.retry.server.support.register.ServerRegister.doRegister(ServerRegister.java:84)
at com.aizuda.easy.retry.server.support.register.AbstractRegister.register(AbstractRegister.java:32)
at com.aizuda.easy.retry.server.support.register.ServerRegister.lambda$start$1(ServerRegister.java:99)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
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: org.apache.ibatis.exceptions.PersistenceException:

Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (easy_retry) has been closed.

The error may exist in file [D:\easy-retry\easy-retry\easy-retry-server\target\classes\mapper\ServerNodeMapper.xml]

The error may involve com.aizuda.easy.retry.server.persistence.mybatis.mapper.ServerNodeMapper.insertOrUpdate

The error occurred while executing an update

Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (easy_retry) has been closed.

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:196)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:181)
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.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)
... 18 common frames omitted

Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (easy_retry) has been closed.
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:83)
at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80)
at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67)
at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:337)
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:86)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62)
at com.sun.proxy.$Proxy97.update(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:194)
... 24 common frames omitted
Caused by: java.sql.SQLException: HikariDataSource HikariDataSource (easy_retry) has been closed.
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:96)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:159)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:117)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
... 39 common frames omitted
在注释了以下代码后启动又没有报错了
图片
Win10系统

您好,您可以按照这个方案改下:

@Bean
public ApplicationRunner nettyStartupChecker(NettyHttpServer nettyHttpServer, ServletWebServerFactory serverFactory) {
    return args -> {
        // 最长自旋10秒,保证nettyHttpServer启动完成
        int waitCount = 0;
        while (!nettyHttpServer.isStarted() || waitCount > 100) {
            TimeUnit.MILLISECONDS.sleep(100);
            waitCount++;
        }

        if (!nettyHttpServer.isStarted()) {
            // Netty启动失败,停止Web服务和Spring Boot应用程序
            serverFactory.getWebServer().stop();
            SpringApplication.exit(SpringApplication.run(EasyRetryServerApplication.class));
        }
    };
}

OK,运行没有报错了