-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Labels
Description
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed GitHub issues.
- Read documentation: ElasticJob Doc.
Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will close it.
Please answer these questions before submitting your issue. Thanks!
Which version of ElasticJob did you use?
elasticjob 3.0.4
Expected behavior
Actual behavior
java.lang.NullPointerException: null
at java.io.StringReader.<init>(StringReader.java:50)
at org.yaml.snakeyaml.reader.StreamReader.<init>(StreamReader.java:57)
at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:473)
at org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine.unmarshal(YamlEngine.java:54)
at org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics.ShardingStatisticsAPIImpl.getShardingInfo(ShardingStatisticsAPIImpl.java:64)
at org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics.ShardingStatisticsAPIImpl.getShardingInfo(ShardingStatisticsAPIImpl.java:47)
Reason analyze (If you can)
private ShardingInfo getShardingInfo(final String jobName, final String item) {
//Obtain the instance. However, the instance may be an offline instance.
String instanceId = regCenter.get(jobNodePath.getShardingNodePath(item, "instance"));
if (null != instanceId) {
// The online instance data is obtained from the instance node based on the offline instance. In this case, the returned result is null.
JobInstance jobInstance = YamlEngine.unmarshal(regCenter.get(jobNodePath.getInstanceNodePath(instanceId)), JobInstance.class);
result.setServerIp(jobInstance.getServerIp());
result.setInstanceId(jobInstance.getJobInstanceId());
}
}