Skip to content

java.lang.NullPointerException: null 空指针异常 #1025

Open
@xinzhuxiansheng

Description

Describe the bug

master分支,执行 "jraft-example"模块下的 election示例,
com.alipay.sofa.jraft.example.election.ElectionBootstrap 的执行参数为

/Users/a/Code/Java/sofa-jraft/tmp/datapath/server01
yzhougid01
127.0.0.1:2881
127.0.0.1:2881

Expected behavior

Actual behavior

发生异常,异常信息为:

2023-08-30 15:16:25 [JRaft-FSMCaller-Disruptor-0] ERROR LogExceptionHandler:64 - Handle FSMCallerImpl disruptor event error, event is com.alipay.sofa.jraft.core.FSMCallerImpl$ApplyTask@49d27be0
java.lang.NullPointerException: null
	at com.alipay.sofa.jraft.example.election.ElectionBootstrap$1.onLeaderStart(ElectionBootstrap.java:53) ~[classes/:?]
	at com.alipay.sofa.jraft.example.election.ElectionOnlyStateMachine.onLeaderStart(ElectionOnlyStateMachine.java:58) ~[classes/:?]
	at com.alipay.sofa.jraft.core.NodeImpl$ConfigurationChangeDone.run(NodeImpl.java:2341) ~[classes/:?]
	at com.alipay.sofa.jraft.core.FSMCallerImpl.doCommitted(FSMCallerImpl.java:554) ~[classes/:?]
	at com.alipay.sofa.jraft.core.FSMCallerImpl.runApplyTask(FSMCallerImpl.java:467) ~[classes/:?]
	at com.alipay.sofa.jraft.core.FSMCallerImpl.access$100(FSMCallerImpl.java:73) ~[classes/:?]
	at com.alipay.sofa.jraft.core.FSMCallerImpl$ApplyTaskHandler.onEvent(FSMCallerImpl.java:150) ~[classes/:?]
	at com.alipay.sofa.jraft.core.FSMCallerImpl$ApplyTaskHandler.onEvent(FSMCallerImpl.java:142) ~[classes/:?]
	at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:137) [disruptor-3.3.7.jar:?]
	at java.lang.Thread.run(Thread.java:750) [?:1.8.0_371]

Steps to reproduce

Minimal yet complete reproducer code (or GitHub URL to code)

Environment

  • SOFAJRaft version:
  • JVM version (e.g. java -version):
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions