[alibaba/nacos]nacos2.2.0启动后闪退,创建bean报错

2025-11-10 149 views
8

nacos2.2.0启动后闪退,在Windows和deepin系统下都能正常启动,阿里云Debian11和腾讯云Centos7上报错,jdk17,mysql5.7,数据库也是创建了的,sql也导入了

启动日志比较大,http://www.lijianc.com/down/start.out 配置文件就改用了MySQL数据库 http://www.lijianc.com/down/application.properties 启动文件改为了默认standalone模式启动 http://www.lijianc.com/down/startup.sh

/opt/java-17-oracle-x64/bin/java -Xms512m -Xmx512m -Xmn128m -Dnacos.standalone=true -Dnacos.member.list= -Xlog:gc*:file=/www/wwwroot/nacos/logs/nacos_gc.log:time,tags:filecount=10,filesize=102400 -Dloader.path=/www/wwwroot/nacos/plugins,/www/wwwroot/nacos/plugins/health,/www/wwwroot/nacos/plugins/cmdb,/www/wwwroot/nacos/plugins/selector -Dnacos.home=/www/wwwroot/nacos -jar /www/wwwroot/nacos/target/nacos-server.jar --spring.config.additional-location=file:/www/wwwroot/nacos/conf/ --logging.config=/www/wwwroot/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288

     ,--.
   ,--.'|

,--,: : | Nacos 2.2.0 ,--.'| ' : ,---. Running in stand alone mode, All function modules | : : | | ' ,'\ .--.--. Port: 8848 : | \ | : ,--.--. ,---. / / | / / ' Pid: 3822 | : ' '; | / \ / . ; ,. :| : /./ Console: http://10.0.0.10:8848/nacos/index.html ' ' ;. ;.--. .-. | / / '' | |: :| : ;_ | | | \ | \__\/: . .. ' / ' | .; : \ \. https://nacos.io ' : | ; .' ," .--.; |' ; :__| : | ----. \ | | '--' / / ,. |' | '.'|\ \ / / /--' / ' : | ; : .' \ : :----' '--'. / ; |.' | , .-./\ \ / --'---' '---'-----'----'

2023-03-15 00:29:15,448 INFO Tomcat initialized with port(s): 8848 (http)

2023-03-15 00:29:15,541 INFO Root WebApplicationContext: initialization completed in 4888 ms

2023-03-15 00:29:18,918 WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'instanceOperatorClientImpl' defined in URL [jar:file:/www/wwwroot/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.0.jar!/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'clientOperationServiceProxy' defined in URL [jar:file:/www/wwwroot/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.0.jar!/com/alibaba/nacos/naming/core/v2/service/ClientOperationServiceProxy.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistentClientOperationServiceImpl' defined in URL [jar:file:/www/wwwroot/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.0.jar!/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.naming.core.v2.service.impl.PersistentClientOperationServiceImpl]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Fail to init node, please see the logs to find the reason.

2023-03-15 00:29:18,955 INFO Nacos Log files: /www/wwwroot/nacos/logs

2023-03-15 00:29:18,955 INFO Nacos Log files: /www/wwwroot/nacos/conf

2023-03-15 00:29:18,955 INFO Nacos Log files: /www/wwwroot/nacos/data

2023-03-15 00:29:18,956 ERROR Startup errors :

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'instanceOperatorClientImpl' defined in URL [jar:file:/www/wwwroot/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.0.jar!/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'clientOperationServiceProxy' defined in URL [jar:file:/www/wwwroot/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.0.jar!/com/alibaba/nacos/naming/core/v2/service/ClientOperationServiceProxy.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistentClientOperationServiceImpl' defined in URL [jar:file:/www/wwwroot/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.0.jar!/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.naming.core.v2.service.impl.PersistentClientOperationServiceImpl]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Fail to init node, please see the logs to find the reason. at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) 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: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.alibaba.nacos.Nacos.main(Nacos.java:35) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467) Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'clientOperationServiceProxy' defined in URL [jar:file:/www/wwwroot/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.0.jar!/com/alibaba/nacos/naming/core/v2/service/ClientOperationServiceProxy.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistentClientOperationServiceImpl' defined in URL [jar:file:/www/wwwroot/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.0.jar!/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.naming.core.v2.service.impl.PersistentClientOperationServiceImpl]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Fail to init node, please see the logs to find the reason.

回答

2

今天又试了一下,发现2核的cpu在开启nacos的时候使用率马上100%,nacos退出后回到0.5%

0

Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistentClientOperationServiceImpl' defined in URL

应该是你修改过源码,导致这个bean丢失了。

3

Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistentClientOperationServiceImpl' defined in URL

应该是你修改过源码,导致这个bean丢失了。

源码没修改过,我估计是2核CPU带不动,我在自己电脑上启动,i5 7500CPU4核的启动的时候CPU利用率能从8%直接飙到84%再慢慢恢复到10%左右

8

我单核机器都能跑动,应该和这个没什么关系吧。

4

你看下使用jdk8或者jdk11是不是可以启动,如果是jdk版本的问题,可能需要深入排查一下了。

7

/opt/java-17-oracle-x64/bin/java -Xms512m -Xmx512m -Xmn128m -Dnacos.standalone=true 腾讯云JDK17的,Java -version显示的就是17 阿里云openjdk11的,Java -version也能正常显示

6

社区目前无法复现你的问题, 你需要从你的环境角度定位一下问题。 目前看到只有你反馈了这个问题,如果有社区中其他人复现,也可以在这里讨论下。