apache / apache/servicecomb-java-chassis
微服务启动失败 -- NullPointer问题
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 814
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 1
Description
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()可能出现了空指针,请问这块是否可以做一下加固?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading CseApplicationListener.java at line 90 and follow the startup path shown in the stack trace, especially around the logged CSE DOWN state. Done means the microservice startup path no longer fails with this NullPointerException and the suspected null state is covered by verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100