diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java index 9ed80efbe3..5db41bd1ed 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java @@ -921,7 +921,15 @@ private void startInfoServer() } private void startPlugins(Configuration conf) { - plugins = conf.getInstances(DFS_DATANODE_PLUGINS_KEY, ServicePlugin.class); + try { + plugins = conf.getInstances(DFS_DATANODE_PLUGINS_KEY, + ServicePlugin.class); + } catch (RuntimeException e) { + String pluginsValue = conf.get(DFS_DATANODE_PLUGINS_KEY); + LOG.error("Unable to load DataNode plugins. Specified list of plugins: " + + pluginsValue, e); + throw e; + } for (ServicePlugin p: plugins) { try { p.start(this); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java index 1752cf7ed4..e7841f02a9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java @@ -809,8 +809,15 @@ private void startCommonServices(Configuration conf) throws IOException { httpServer.setFSImage(getFSImage()); } rpcServer.start(); - plugins = conf.getInstances(DFS_NAMENODE_PLUGINS_KEY, - ServicePlugin.class); + try { + plugins = conf.getInstances(DFS_NAMENODE_PLUGINS_KEY, + ServicePlugin.class); + } catch (RuntimeException e) { + String pluginsValue = conf.get(DFS_NAMENODE_PLUGINS_KEY); + LOG.error("Unable to load NameNode plugins. Specified list of plugins: " + + pluginsValue, e); + throw e; + } for (ServicePlugin p: plugins) { try { p.start(this);