[YARN] : NullPointerException in MRClientService.getHttpPort()
Join the DZone community and get the full member experience.
Join For FreeHave you moved your Hadoop jobs over to Yarn? Are you seeing the following NullPointerException coming out of your job?
Caused by: java.lang.NullPointerException at org.apache.hadoop.mapreduce.v2.app.client.MRClientService.getHttpPort(MRClientService.java:167) at org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator.register(RMCommunicator.java:150) ... 14 moreThis appears to be a poorly handled case in Hadoop, where the webApp fails to load. You need to look at the full log file. You will likely see the following in the log preceeding the NPE:
ERROR (org.apache.hadoop.mapreduce.v2.app.client.MRClientService:139) - Webapps failed to start. Ignoring for now:That line is produced by the following code in YARN:
LOG.info("Instantiated MRClientService at " + this.bindAddress); try { webApp = WebApps.$for("mapreduce", AppContext.class, appContext, "ws").with(conf). start(new AMWebApp()); } catch (Exception e) { LOG.error("Webapps failed to start. Ignoring for now:", e); } super.start();This means your webApp failed to load. In my case, this was caused by dependency conflicts on my classpath. (servlet & jasper compiler) I've also seen it cause by a dependency mssing, such as:
java.lang.ClassNotFoundException: Class org.apache.hadoop.yarn.server.webproxy.amfilter.AmFilterInitializerIn my situation, the solution was to cleanup my classpath, but the webApp might fail for lots of reasons, which will result in an NPE later in the log file when MRClientService attempts to getHttpPort without a webApp, which is shown in the following code:
public int getHttpPort() { return webApp.port(); }Anyway, that is probably more detail than you wanted. Happy yarning.
career
Classpath (Java)
Dependency
hadoop
JasPer
Published at DZone with permission of Brian O' Neill, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
Tactics and Strategies on Software Development: How To Reach Successful Software [Video]
-
RBAC With API Gateway and Open Policy Agent (OPA)
-
How to Implement Istio in Multicloud and Multicluster
-
Seven Steps To Deploy Kedro Pipelines on Amazon EMR
Comments