开发者社区 > 云原生 > 正文

NacosConfigApplication启动时偶然出现空指针

java.lang.NullPointerException: null at java.util.LinkedList$ListItr.next(LinkedList.java:893) ~[na:1.8.0_71] at com.alibaba.nacos.spring.context.event.DeferredApplicationEventPublisher.replayDeferredEvents(DeferredApplicationEventPublisher.java:75) ~[nacos-spring-context-0.2.2-RC1.jar:na] at com.alibaba.nacos.spring.context.event.DeferredApplicationEventPublisher.onApplicationEvent(DeferredApplicationEventPublisher.java:69) ~[nacos-spring-context-0.2.2-RC1.jar:na] at com.alibaba.nacos.spring.context.event.DeferredApplicationEventPublisher.onApplicationEvent(DeferredApplicationEventPublisher.java:37) ~[nacos-spring-context-0.2.2-RC1.jar:na] at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:400) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:354) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:888) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:161) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at com.alibaba.nacos.example.spring.boot.NacosConfigApplication.main(NacosConfigApplication.java:25) [classes/:na]

1、启动时报错。偶然性出现,但出现次数还是比较高,一个下午会出现五六次

2、重新启动又好了

原提问者GitHub用户15057196735

展开
收起
学习娃 2023-05-22 16:09:28 68 0
1 条回答
写回答
取消 提交回答
  • 该错误不是发生在 Nacos-Server 中,而是发生在 nacos-spring-boot-config-example 0.2.0.RELEASE 包下 根据你提供的环境,跟进源码发现,并没有发生你说的这个问题(反复启动数十次并没有发生该问题) 请进一步提供问题详情信息

    原回答者GitHub用户SteafanMrZhou

    2023-05-23 09:35:42
    赞同 展开评论 打赏
问答地址:

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载