ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

Nacos版本差异导致的启动失败问题(Windows10下)解决办法

2020-12-15 20:32:52  阅读:68  来源: 互联网

标签:factory 解决办法 exception java nacos springframework Nacos org Windows10


在Windows10下启动Nacos1.1.3正常,但是尝试启动Nacos1.4.0和1.3.2时,失败,部分异常如下:

"nacos is starting with cluster"

         ,--.
       ,--.'|
   ,--,:  : |                                           Nacos 1.4.0
,`--.'`|  ' :                       ,---.               Running in cluster mode, All function modules
|   :  :  | |                      '   ,'\   .--.--.    Port: 8848
:   |   \ | :  ,--.--.     ,---.  /   /   | /  /    '   Pid: 31804
|   : '  '; | /       \   /     \.   ; ,. :|  :  /`./   Console: http://192.168.0.100:8848/nacos/index.html
'   ' ;.    ;.--.  .-. | /    / ''   | |: :|  :  ;_
|   | | \   | \__\/: . ..    ' / '   | .; : \  \    `.      https://nacos.io
'   : |  ; .' ," .--.; |'   ; :__|   :    |  `----.   \
|   | '`--'  /  /  ,.  |'   | '.'|\   \  /  /  /`--'  /
'   : |     ;  :   .'   \   :    : `----'  '--'.     /
;   |.'     |  ,     .-./\   \  /            `--'---'
'---'        `--`---'     `----'


java.io.IOException: java.lang.IllegalArgumentException: db.num is null
        at com.alibaba.nacos.config.server.service.datasource.ExternalDataSourceServiceImpl.reload(ExternalDataSourceServiceImpl.java:141)
        at com.alibaba.nacos.config.server.service.datasource.ExternalDataSourceServiceImpl.init(ExternalDataSourceServiceImpl.java:115)


Caused by: java.lang.IllegalArgumentException: db.num is null
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:135)
        at com.alibaba.nacos.config.server.service.datasource.ExternalDataSourceProperties.build(ExternalDataSourceProperties.java:96)
        at com.alibaba.nacos.config.server.service.datasource.ExternalDataSourceServiceImpl.reload(ExternalDataSourceServiceImpl.java:130)
        ... 168 more


Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat


Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authFilterRegistration' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.FilterRegistrationBean]: Factory method 'authFilterRegistration' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter': Unsatisfied dependency expressed through field 'authManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosAuthManager': Unsatisfied dependency expressed through field 'authenticationManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosAuthConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosUserDetailsServiceImpl': Unsatisfied dependency expressed through field 'userPersistService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'externalUserPersistServiceImpl': Unsatisfied dependency expressed through field 'persistService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'externalStoragePersistServiceImpl': Invocation of init method failed; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error]load jdbc.properties error


Caused by: java.lang.RuntimeException: [db-load-error]load jdbc.properties error

2020-12-15 19:26:09,273 ERROR Nacos failed to start, please see D:\Soft-Dellvostro\Soft\Distributed\Tools\nacos-server-1.4.0\logs\nacos.log for more details.

查了好长时间,没有发现有用的线索。无奈之下,只好从头开始分析日志。发现开头的"nacos is starting with cluster"提醒。于是,查了一下1.1.3到1.3.2再到1.4.0的相关差异,得知1.4.0的默认启动模式就是集群模式。而集群模式在没有进行集群配置的情况下,就会启动失败。

解决办法:将startup.cmd中的set MODE="cluster"修改为set MODE="standalone"。另外,application.properties的所有配置使用默认值即可。我之前尝试解决启动失败问题,曾将# spring.datasource.platform=mysql的注释取消了。该注释取消之后,也会导致Nacos启动失败。

启动成功后,命令行界面显示如下:

2020-12-15 20:07:05,867 INFO Nacos started successfully in stand alone mode. use embedded storage

 

标签:factory,解决办法,exception,java,nacos,springframework,Nacos,org,Windows10
来源: https://blog.csdn.net/shinyolive/article/details/111238438

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有