Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nacos2.4.1启动错误(nacos startup error) #12516

Closed
superChakra opened this issue Aug 19, 2024 · 1 comment
Closed

nacos2.4.1启动错误(nacos startup error) #12516

superChakra opened this issue Aug 19, 2024 · 1 comment
Labels
status/duplicate This issue or pull request already exists

Comments

@superChakra
Copy link

Issue Description

Type: * Could not initialize class com.alibaba.nacos.consistency.SerializeFactory*

Describe what happened (or what feature you want)

I start nacos encountered Could not initialize class com. Alibaba. Nacos. Consistency. SerializeFactory error and Unable to make fields private java.lang.String java.lang.StackTraceElement.classLoaderName accessible: module java.base does not "opens java.lang" to unnamed module @7f63425a

我启动nacos时遇到 Could not initialize class com.alibaba.nacos.consistency.SerializeFactory报错和Unable to make field private java.lang.String java.lang.StackTraceElement.classLoaderName accessible: module java.base does not "opens java.lang" to unnamed module @7f63425a

Describe what you expected to happen

I hope the official website can help me solve this problem.

我希望官网可以帮做我解决这个问题。

How to reproduce it (as minimally and precisely as possible)

  1. Unable to make field private java.lang.String java.lang.StackTraceElement.classLoaderName accessible: module java.base does not "opens java.lang" to unnamed module @7f63425a

  2. Could not initialize class com.alibaba.nacos.consistency.SerializeFactory

Tell us your environment

openjdk 17.0.12 2024-07-16
OpenJDK Runtime Environment (build 17.0.12+7-Ubuntu-1ubuntu222.04)
Apache Maven 3.9.7
abuntu22.04

Anything else we need to know?

部分详细的报错信息:

java.lang.reflect.InaccessibleObjectException: Unable to make field private byte java.lang.StackTraceElement.format accessible: module java.base does not "opens java.lang" to unnamed module @7f63425a
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
at com.caucho.hessian.io.JavaDeserializer.getFieldMap(JavaDeserializer.java:363)
at com.caucho.hessian.io.JavaDeserializer.(JavaDeserializer.java:72)
at com.caucho.hessian.io.StackTraceElementDeserializer.(StackTraceElementDeserializer.java:60)
at com.caucho.hessian.io.ContextSerializerFactory.(ContextSerializerFactory.java:481)
at com.caucho.hessian.io.SerializerFactory.(SerializerFactory.java:143)
at com.caucho.hessian.io.SerializerFactory.(SerializerFactory.java:137)
at com.alibaba.nacos.consistency.serialize.NacosHessianSerializerFactory.(NacosHessianSerializerFactory.java:59)
at com.alibaba.nacos.consistency.serialize.HessianSerializer.(HessianSerializer.java:41)
at com.alibaba.nacos.consistency.SerializeFactory.(SerializeFactory.java:39)
at com.alibaba.nacos.core.distributed.raft.JRaftProtocol.(JRaftProtocol.java:100)
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration.lambda$strongAgreementProtocol$0(ConsistencyConfiguration.java:40)
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration.getProtocol(ConsistencyConfiguration.java:53)
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration.strongAgreementProtocol(ConsistencyConfiguration.java:40)
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration$$EnhancerBySpringCGLIB$$fed45d95.CGLIB$strongAgreementProtocol$0()
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration$$EnhancerBySpringCGLIB$$fed45d95$$FastClassBySpringCGLIB$$60478ed4.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration$$EnhancerBySpringCGLIB$$fed45d95.strongAgreementProtocol()
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:569)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:641)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:626)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
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:336)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:234)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1284)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1245)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:494)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:349)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1189)
at com.alibaba.nacos.sys.utils.ApplicationUtils.getBeanIfExist(ApplicationUtils.java:155)
at com.alibaba.nacos.core.distributed.ProtocolManager.initCPProtocol(ProtocolManager.java:124)
at com.alibaba.nacos.core.distributed.ProtocolManager.getCpProtocol(ProtocolManager.java:85)
at com.alibaba.nacos.naming.cluster.ServerStatusManager.hasLeader(ServerStatusManager.java:70)
at com.alibaba.nacos.naming.cluster.ServerStatusManager.refreshServerStatus(ServerStatusManager.java:62)
at com.alibaba.nacos.naming.cluster.ServerStatusManager.access$000(ServerStatusManager.java:37)
at com.alibaba.nacos.naming.cluster.ServerStatusManager$ServerStatusUpdater.run(ServerStatusManager.java:92)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
2024-08-19 12:50:45,551 INFO Filter requestContextFilter was not registered (possibly already registered?)

2024-08-19 12:50:47,948 WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'switchManager' defined in URL [jar:file:/home/chakra/info/nacos/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.4.1.jar!/com/alibaba/nacos/naming/misc/SwitchManager.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.naming.misc.SwitchManager]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.nacos.consistency.SerializeFactory

2024-08-19 12:50:47,985 WARN [WatchFileCenter] start close

2024-08-19 12:50:47,986 WARN [WatchFileCenter] start to shutdown this watcher which is watch : /home/chakra/info/nacos/nacos/conf

2024-08-19 12:50:48,008 WARN [WatchFileCenter] already closed

2024-08-19 12:50:48,008 WARN [NotifyCenter] Start destroying Publisher

2024-08-19 12:50:48,009 WARN [NotifyCenter] Destruction of the end

2024-08-19 12:50:48,009 ERROR Nacos failed to start, please see /home/chakra/info/nacos/nacos/logs/nacos.log for more details.

2024-08-19 12:50:48,028 INFO

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2024-08-19 12:50:48,074 ERROR Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'switchManager' defined in URL [jar:file:/home/chakra/info/nacos/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.4.1.jar!/com/alibaba/nacos/naming/misc/SwitchManager.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.naming.misc.SwitchManager]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.nacos.consistency.SerializeFactory
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:306)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:287)
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:336)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
at com.alibaba.nacos.Nacos.main(Nacos.java:46)
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:569)
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.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.naming.misc.SwitchManager]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.nacos.consistency.SerializeFactory
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:226)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:302)
... 27 common frames omitted
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.nacos.consistency.SerializeFactory
at com.alibaba.nacos.naming.misc.SwitchManager.(SwitchManager.java:87)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:213)
... 29 common frames omitted
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "com.alibaba.nacos.naming.timer.0"]
at com.caucho.hessian.io.SerializerFactory.(SerializerFactory.java:143)
at com.caucho.hessian.io.SerializerFactory.(SerializerFactory.java:137)
at com.alibaba.nacos.consistency.serialize.NacosHessianSerializerFactory.(NacosHessianSerializerFactory.java:59)
at com.alibaba.nacos.consistency.serialize.HessianSerializer.(HessianSerializer.java:41)
at com.alibaba.nacos.consistency.SerializeFactory.(SerializeFactory.java:39)
at com.alibaba.nacos.core.distributed.raft.JRaftProtocol.(JRaftProtocol.java:100)
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration.lambda$strongAgreementProtocol$0(ConsistencyConfiguration.java:40)
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration.getProtocol(ConsistencyConfiguration.java:53)
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration.strongAgreementProtocol(ConsistencyConfiguration.java:40)
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration$$EnhancerBySpringCGLIB$$fed45d95.CGLIB$strongAgreementProtocol$0()
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration$$EnhancerBySpringCGLIB$$fed45d95$$FastClassBySpringCGLIB$$60478ed4.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
at com.alibaba.nacos.core.distributed.ConsistencyConfiguration$$EnhancerBySpringCGLIB$$fed45d95.strongAgreementProtocol()
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:569)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:641)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:626)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
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:336)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:234)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1284)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1245)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:494)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:349)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1189)
at com.alibaba.nacos.sys.utils.ApplicationUtils.getBeanIfExist(ApplicationUtils.java:155)
at com.alibaba.nacos.core.distributed.ProtocolManager.initCPProtocol(ProtocolManager.java:124)
at com.alibaba.nacos.core.distributed.ProtocolManager.getCpProtocol(ProtocolManager.java:85)
at com.alibaba.nacos.naming.cluster.ServerStatusManager.hasLeader(ServerStatusManager.java:70)
at com.alibaba.nacos.naming.cluster.ServerStatusManager.refreshServerStatus(ServerStatusManager.java:62)
at com.alibaba.nacos.naming.cluster.ServerStatusManager.access$000(ServerStatusManager.java:37)
at com.alibaba.nacos.naming.cluster.ServerStatusManager$ServerStatusUpdater.run(ServerStatusManager.java:92)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
2024-08-19 12:50:48,104 WARN [ThreadPoolManager] Start destroying ThreadPool

2024-08-19 12:50:48,104 WARN [ThreadPoolManager] Destruction of the end

@superChakra superChakra changed the title nacos启动错误(nacos startup error) nacos2.4.1启动错误(nacos startup error) Aug 19, 2024
@KomachiSion
Copy link
Collaborator

duplicate with #12503 #12498

@KomachiSion KomachiSion closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2024
@KomachiSion KomachiSion added the status/duplicate This issue or pull request already exists label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants