微服务启动失败 -- NullPointer问题
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- java, spring-boot
- 领域
- backend
调研方向
首先阅读第 90 行的 CseApplicationListener.java,并按照堆栈跟踪中显示的启动路径进行跟踪,尤其关注记录的 CSE DOWN 状态附近。完成的标志是微服务启动路径不再因这个 NullPointerException 失败,并且通过验证覆盖了疑似的 null 状态。
由索引模型根据 Issue 内容生成。
描述
2.6.0版本,微服务在启动的时候,偶现微服务启动失败,错误日志中显示是由空指针引起的
错误日志如下
[2023-11-02 18:38:10.376+08:00] [INFO] [AuditLogReportTask]-[] [] | o.a.s.f.common.utils.SPIServiceUtils Found SPI service org.apache.servicecomb.core.ConsumerProvider, count=0.
[2023-11-02 18:38:10.375+08:00] [INFO] [main]-[] [] | c.h.g.notice.config.LogLevelMonitor change loglevel to [DEBUG] end
[2023-11-02 18:38:10.378+08:00] [INFO] [main]-[] [] | c.h.g.notice.config.LogLevelMonitor start to rollBack loglevel
Nov 02, 2023 6:38:12 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
WARNING: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [101] milliseconds.
[2023-11-02 18:38:12.973+08:00] [WARN] [AuditLogReportTask]-[] [] | com.huawei.gts.operlog.LogReportTask The current registration for CSE service has not been completed, cse status: DOWN
[2023-11-02 18:38:16.120+08:00] [ERROR] [main]-[] [] | o.s.boot.SpringApplication Application run failed
java.lang.NullPointerException:
at org.apache.servicecomb.core.CseApplicationListener.onApplicationEvent(CseApplicationListener.java:90)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378)
at org.springframework.boot.context.event.EventPublishingRunListener.ready(EventPublishingRunListener.java:114)
at org.springframework.boot.SpringApplicationRunListeners.lambda$ready$6(SpringApplicationRunListeners.java:82)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
at org.springframework.boot.SpringApplicationRunListeners.ready(SpringApplicationRunListeners.java:82)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
at com.huawei.gts.notice.NoticeServiceApplication.main(NoticeServiceApplication.java:65)
单纯从代码中看,是在CSEApplicationListener中的 scbEngine.getProducerProviderManager().getProducerProviderList()可能出现了空指针,请问这块是否可以做一下加固?
- 主要语言
- Java
- 星标
- 1.9k
- 派生
- 813
- 平均合并
- 8 天 23 小时
- 30 天内合并 PR
- 1
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/servicecomb-java-chassis 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
apache/servicecomb-java-chassis#5106 ·
-
question
难度 5/5 一周以上 新手友好度 35/100
apache/servicecomb-java-chassis#5153 · 1 条评论 ·
-
question
难度 4/5 3-5 天 新手友好度 25/100
apache/servicecomb-java-chassis#5146 ·
-
[FEATURE] - When will ServiceComb support Spring Boot 4.x, Spring Framework 7.x, and Jackson 3.x? 未关闭enhancement
难度 5/5 一周以上 新手友好度 25/100
apache/servicecomb-java-chassis#5145 ·
-
2.x bug
apache/servicecomb-java-chassis#5141 · 已指派 1 人 ·
查看 apache/servicecomb-java-chassis 的全部 Issue
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 65/100
inu-appcenter/memorIN-backend#288 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
frontend maui-pilot pilot-ask question
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
area/plugin
难度 2/5 1-3 小时 新手友好度 75/100
kestra-io/plugin-kestra#190 ·