[Solved] nacos Startup Error: Error creating bean with name ‘authFilterRegistration‘ defined in class path resource

Today, an error was suddenly reported when Nacos was started. The error information on the Nacos startup interface is as follows:

 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

Idea spooling error message:

[NACOS SocketTimeoutException httpGet] currentServerAddr:http://localhost:8848, err : connect timed out

Cause analysis: the project may not load Nacos related files correctly

Solution: delete the existing Nacos folder, decompress or download the Nacos compressed package again, and start startup.cmd. The problem is solved

If an error is reported, it may be that set mode = “” in the startup.cmd file is inappropriate

set BASE_DIR="%BASE_DIR:~0,-5%"

set CUSTOM_SEARCH_LOCATIONS=file:%BASE_DIR%/conf/

set MODE="cluster"
set FUNCTION_MODE="all"
set SERVER=nacos-server
set MODE_INDEX=-1
set FUNCTION_MODE_INDEX=-1
set SERVER_INDEX=-1
set EMBEDDED_STORAGE_INDEX=-1
set EMBEDDED_STORAGE=""

Solution: change set mode = "cluster" to set mode = "standalone".

Read More: