可能原因一: 集群切换单机
startup -m standalone
可能原因二: derby-data文件夹内文件解析失败
解决方案: 删了derby-data文件夹重启就行
报错信息(供网友搜索):
2021-08-11 13:11:37,550 WARN Exception encountered during context
initialization - cancelling refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed
through field 'userDetailsService'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'customUserDetailsServiceImpl': Unsatisfied dependency
expressed through field 'persistService'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'persistService': Invocation of init method failed; nested exception
is org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'localDataSourceService': Invocation of init method failed; nested
exception is java.lang.RuntimeException: load schema.sql
error.org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Failed to start database 'E:\nacos\data\derby-data'
with class loader
org.springframework.boot.loader.LaunchedURLClassLoader@59f99ea, see the next
exception for details.) WARNING: An illegal reflective access operation has
occurred WARNING: Illegal reflective access by
org.apache.catalina.loader.WebappClassLoaderBase
(jar:file:/E:/nacos/target/nacos-server.jar!/BOOT-INF/lib/tomcat-embed-core-9.0.13.jar!/)
to field java.io.ObjectStreamClass$Caches.localDescs WARNING: Please consider
reporting this to the maintainers of
org.apache.catalina.loader.WebappClassLoaderBase WARNING: Use
--illegal-access=warn to enable warnings of further illegal reflective access
operations WARNING: All illegal access operations will be denied in a future
release 2021-08-11 13:11:37,591 INFO Nacos Log files: E:\nacos/logs/ 2021-08-11
13:11:37,591 INFO Nacos Conf files: E:\nacos/conf/ 2021-08-11 13:11:37,592 INFO
Nacos Data files: E:\nacos/data/ 2021-08-11 13:11:37,592 ERROR Nacos failed to
start, please see E:\nacos/logs/nacos.log for more details. 2021-08-11
13:11:37,599 INFO Error starting ApplicationContext. To display the conditions
report re-run your application with 'debug' enabled. 2021-08-11 13:11:37,600
ERROR Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed
through field 'userDetailsService'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'customUserDetailsServiceImpl': Unsatisfied dependency
expressed through field 'persistService'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'persistService': Invocation of init method failed; nested exception
is org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'localDataSourceService': Invocation of init method failed; nested
exception is java.lang.RuntimeException: load schema.sql
error.org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Failed to start database 'E:\nacos\data\derby-data'
with class loader
org.springframework.boot.loader.LaunchedURLClassLoader@59f99ea, see the next
exception for details.) at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
at
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1378)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.alibaba.nacos.Nacos.main(Nacos.java:33) at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566) at
org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at
org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at
org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:593)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'customUserDetailsServiceImpl': Unsatisfied
dependency expressed through field 'persistService'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'persistService': Invocation of init method failed; nested exception
is org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'localDataSourceService': Invocation of init method failed; nested
exception is java.lang.RuntimeException: load schema.sql
error.org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Failed to start database 'E:\nacos\data\derby-data'
with class loader
org.springframework.boot.loader.LaunchedURLClassLoader@59f99ea, see the next
exception for details.) at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
at
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1378)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at
org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:273)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1237)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1164)
at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593)
... 27 common frames omitted Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'persistService': Invocation of init method failed; nested exception
is org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'localDataSourceService': Invocation of init method failed; nested
exception is java.lang.RuntimeException: load schema.sql
error.org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Failed to start database 'E:\nacos\data\derby-data'
with class loader
org.springframework.boot.loader.LaunchedURLClassLoader@59f99ea, see the next
exception for details.) at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:139)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:419)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1737)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at
org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:273)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1237)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1164)
at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593)
... 40 common frames omitted Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'localDataSourceService': Invocation of init method failed; nested
exception is java.lang.RuntimeException: load schema.sql
error.org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Failed to start database 'E:\nacos\data\derby-data'
with class loader
org.springframework.boot.loader.LaunchedURLClassLoader@59f99ea, see the next
exception for details.) at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:139)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:419)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1737)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1083)
at
com.alibaba.nacos.config.server.service.DynamicDataSource.getDataSource(DynamicDataSource.java:52)
at
com.alibaba.nacos.config.server.service.PersistService.init(PersistService.java:91)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566) at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363)
at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307)
at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
... 52 common frames omitted Caused by: java.lang.RuntimeException: load
schema.sql error.org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Failed to start database 'E:\nacos\data\derby-data'
with class loader
org.springframework.boot.loader.LaunchedURLClassLoader@59f99ea, see the next
exception for details.) at
com.alibaba.nacos.config.server.service.LocalDataSourceServiceImpl.reload(LocalDataSourceServiceImpl.java:110)
at
com.alibaba.nacos.config.server.service.LocalDataSourceServiceImpl.init(LocalDataSourceServiceImpl.java:94)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566) at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363)
at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307)
at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
... 70 common frames omitted