Hi Min,

Sorry about that. Have no idea why your previous is not in the mailing
list (at least I can't find in the mailing list archive), it could be
due to mail outage (https://blogs.apache.org/infra/entry/mail_outage).

The classpath used by the AM is different than the one you specified
in the classpath of the client process (AM is a separate process).
Currently AM has "$HADOOP_CONF_DIR" in it's classpath. Is the class
"com.mzhou.grid.hadoop.GridTopology" available in the $HADOOP_CONF_DIR
on each box in the cluster?

Terence

On Sat, May 10, 2014 at 11:58 PM, Min Zhou <[email protected]> wrote:
> Seems no one here can help me..
>
>
>
>
> On Thu, May 8, 2014 at 6:52 PM, Min Zhou <[email protected]> wrote:
>
>> Hi folks,
>>
>>
>> I run the helloworld example like this way
>>
>>   CP=`hadoop classpath`; java -cp
>> twill-examples-yarn-0.3.0-incubating-SNAPSHOT.jar:$CP  
>> org.apache.twill.example.yarn.HelloWorld
>> zk1:2181,zk2:2181,zk3:2181
>>
>> but got an exception that rack resolver class can't be found in
>> ApplicationMaster
>>
>>
>> 01:21:19.723 [main] INFO  o.a.hadoop.service.AbstractService - Service
>> org.apache.hadoop.yarn.client.api.impl.AMRMClientImpl failed in state
>> INITED; cause: java.lang.RuntimeException: java.lang.RuntimeException:
>> java.lang.ClassNotFoundException: Class com.mzhou.grid.hadoop.GridTopology
>> not found
>> java.lang.RuntimeException: java.lang.RuntimeException:
>> java.lang.ClassNotFoundException: Class com.mzhou.grid.hadoop.GridTopology
>> not found
>>     at
>> org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1927)
>> ~[hadoop-common-2.4.0.SNAPSHOT.jar:na]
>>     at org.apache.hadoop.yarn.util.RackResolver.init(RackResolver.java:52)
>> ~[hadoop-yarn-common-2.4.0.SNAPSHOT.jar:na]
>>     at
>> org.apache.hadoop.yarn.client.api.impl.AMRMClientImpl.serviceInit(AMRMClientImpl.java:160)
>> ~[hadoop-yarn-client-2.4.0.SNAPSHOT.jar:na]
>>     at
>> org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
>> ~[hadoop-common-2.4.0.SNAPSHOT.jar:na]
>>     at
>> org.apache.twill.internal.yarn.Hadoop21YarnAMClient.<init>(Hadoop21YarnAMClient.java:68)
>> [twill-examples-yarn-0.3.0-incubating-SNAPSHOT.jar:na]
>>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method) [na:1.7.0_45]
>>     at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>> [na:1.7.0_45]
>>     at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>> [na:1.7.0_45]
>>     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>> [na:1.7.0_45]
>>     at
>> org.apache.twill.internal.yarn.VersionDetectYarnAMClientFactory.create(VersionDetectYarnAMClientFactory.java:49)
>> [twill-examples-yarn-0.3.0-incubating-SNAPSHOT.jar:na]
>>     at
>> org.apache.twill.internal.appmaster.ApplicationMasterService.<init>(ApplicationMasterService.java:146)
>> [twill-examples-yarn-0.3.0-incubating-SNAPSHOT.jar:na]
>>     at
>> org.apache.twill.internal.appmaster.ApplicationMasterMain.main(ApplicationMasterMain.java:67)
>> [twill-examples-yarn-0.3.0-incubating-SNAPSHOT.jar:na]
>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> ~[na:1.7.0_45]
>>     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> ~[na:1.7.0_45]
>>     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> ~[na:1.7.0_45]
>>     at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
>>     at org.apache.twill.launcher.TwillLauncher.main(TwillLauncher.java:86)
>> [launcher.ee70e7a7-30a1-4c10-848d-5a4ceea60c38.jar:na]
>> Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException:
>> Class com.mzhou.grid.hadoop.GridTopology not found
>>     at
>> org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1895)
>> ~[hadoop-common-2.4.0.SNAPSHOT.jar:na]
>>     at
>> org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1919)
>> ~[hadoop-common-2.4.0.SNAPSHOT.jar:na]
>>     ... 16 common frames omitted
>> Caused by: java.lang.ClassNotFoundException: Class
>> com.mzhou.grid.hadoop.GridTopology not found
>>     at
>> org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1801)
>> ~[hadoop-common-2.4.0.SNAPSHOT.jar:na]
>>     at
>> org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1893)
>> ~[hadoop-common-2.4.0.SNAPSHOT.jar:na]
>>     ... 17 common frames omitted
>> 01:21:19.724 [main] DEBUG o.a.hadoop.service.AbstractService - Service:
>> org.apache.hadoop.yarn.client.api.impl.AMRMClientImpl entered state STOPPED
>> Cleanup directory tmp/twill.launcher-1399598478022-
>>
>>
>> I do assure that com.mzhou.grid.hadoop.GridTopology is in `hadoop
>> classpath`.  Seems twill's ApplicationMaster didn't add that jar into
>> classpath when using a brand new Configuration instance.
>>
>> Anyone can fix it?
>>
>> Thanks,
>> Min
>> --
>> My research interests are distributed systems, parallel computing and
>> bytecode based virtual machine.
>>
>> My profile:
>> http://www.linkedin.com/in/coderplay
>> My blog:
>> http://coderplay.javaeye.com
>>
>
>
>
> --
> My research interests are distributed systems, parallel computing and
> bytecode based virtual machine.
>
> My profile:
> http://www.linkedin.com/in/coderplay
> My blog:
> http://coderplay.javaeye.com

Reply via email to