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

微服务启动失败 -- NullPointer问题 #4013

Open
yanghao605 opened this issue Nov 6, 2023 · 2 comments
Open

微服务启动失败 -- NullPointer问题 #4013

yanghao605 opened this issue Nov 6, 2023 · 2 comments

Comments

@yanghao605
Copy link
Contributor

yanghao605 commented Nov 6, 2023

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()可能出现了空指针,请问这块是否可以做一下加固?

@liubao68
Copy link
Contributor

liubao68 commented Nov 6, 2023

2.6.0的代码的90行貌似不会为空哦,能够知道如何复现该问题吗?

@yanghao605
Copy link
Contributor Author

yanghao605 commented Nov 9, 2023

不是90行,是第85行,我们对源码加了点日志,所以日志中显示是第90行有问题。当前不知道复现条件,只是偶尔会出现一次,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants