ExploreHeart opened a new issue, #2452: URL: https://github.com/apache/shardingsphere-elasticjob/issues/2452
## Bug Report **For English only**, other languages will not accept. Before report a bug, make sure you have: - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere-elasticjob/issues). - Read documentation: [ElasticJob Doc](https://shardingsphere.apache.org/elasticjob/current/en/overview/). 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()); } } ``` ### Steps to reproduce the behavior. ### Example codes for reproduce this issue (such as a github link). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
