hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoltan Haindrich (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-8252) Fix ServiceMaster main not found
Date Mon, 07 May 2018 15:10:00 GMT

    [ https://issues.apache.org/jira/browse/YARN-8252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16466001#comment-16466001

Zoltan Haindrich commented on YARN-8252:

the problem is that {{ServiceMaster}} extends {{CompositeService}} ; which is in {{hadoop-common.jar}}
- hence the class containing the main method could not be loaded...it's unfortunate that the
jvm is unable to provide more information about the problem

I think it would be better to separate the main method to be in a separate class file.

And this brings me to the originial problem: because I've run into this... it seems "hadoop-common"
is not on the classpath when ServiceMaster is starting up (invoked using api to bring up llap

> Fix ServiceMaster main not found
> --------------------------------
>                 Key: YARN-8252
>                 URL: https://issues.apache.org/jira/browse/YARN-8252
>             Project: Hadoop YARN
>          Issue Type: Bug
>    Affects Versions: 3.1.0
>            Reporter: Zoltan Haindrich
>            Priority: Major
> I was looking into using yarn services; however it seems for some reason it is not possible
to run {{ServiceMaster}} class from the jar...I might be missing some fundamental...so I've
put together a shellscript to make it easy for anyone to check....I would be happy with any
exception beyond main not found....
> [ServiceMaster.main method|https://github.com/apache/hadoop/blob/67f239c42f676237290d18ddbbc9aec369267692/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceMaster.java#L305]
> {code:java}
> #!/bin/bash
> set -e
> wget -O core.jar  -nv http://central.maven.org/maven2/org/apache/hadoop/hadoop-yarn-services-core/3.1.0/hadoop-yarn-services-core-3.1.0.jar
> unzip -qn core.jar
> cat > org/apache/hadoop/yarn/service/ServiceMaster2.java << EOF
> package org.apache.hadoop.yarn.service;
> public class ServiceMaster2 {
>   public static void main(String[] args) throws Exception {
>     System.out.println("asd!");
>   }
> }
> javac org/apache/hadoop/yarn/service/ServiceMaster2.java
> jar -cf a1.jar org
> find org -name ServiceMaster*
> # this will print "asd!"
> java -cp a1.jar org.apache.hadoop.yarn.service.ServiceMaster2
> #the following invocations result in:
> # Error: Could not find or load main class org.apache.hadoop.yarn.service.ServiceMaster
> #
> set +e
> java -cp a1.jar org.apache.hadoop.yarn.service.ServiceMaster
> java -cp core.jar org.apache.hadoop.yarn.service.ServiceMaster
> {code}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org

View raw message