全网最全关于Nacos2.1.2 本地单机模式启动报错问题解决,网上的各种方法都试过了,但是都没有解决我的问题。折腾了三天,去官方的Issues下面找到一些思路,尝试之后,问题解决。
错误日志
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'instanceOperatorClientImpl' defined in URL [jar:file:/C:/Users/XinLiu/OneDrive/妗岄潰/env/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.0.2.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:/C:/Users/XinLiu/OneDrive/妗岄潰/env/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.0.2.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:/C:/Users/XinLiu/OneDrive/妗岄潰/env/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.0.2.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:769) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:218) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1185) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:554) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:514) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:319) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:866) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) at com.alibaba.nacos.Nacos.main(Nacos.java:35) 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.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)
解决方案
综合各大网友的错误,主要考虑以下几点原因
1. nacos存放路径带有中文字符或特殊符号
解决办法:
路径有中文 识别不了,把 nacos 放到没有中文的路径下再次启动就行了。
2.系统缺少 vc++ 2015运行库
解决办法:
下载对应的运行库;下载地址:我自己的网盘地址:https://pan.baidu.com/s/1ZhstKl-a3yA1bOv9qOL5pA?pwd=yq02
提取码:yq02 下载后直接安装即可,建议都装一下吧。安装完成后重启nacos 。
前两条我都尝试了,问题没解决/(ㄒoㄒ)/~~
3. jdk不是64位的(本人Windows10操作系统)
由于重做了系统,朋友给了一个jdk8,当时没注意看是不是64位的,直接安装了。结果导致nacos报上面的错误(((φ(◎ロ◎;)φ)))。
解决办法:
先查看自己的jdk是不是64位的?查看安装的jdk是不是64位。如果不是,卸载、jdk重装,jdk版本>=1.8。
重启nacos,问题解决o( ̄▽ ̄)ブ
祝君安好!!!
来源地址:https://blog.csdn.net/YiYang_sky/article/details/129838816