[ 
https://issues.apache.org/jira/browse/TWILL-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13987684#comment-13987684
 ] 

Alex Chin commented on TWILL-65:
--------------------------------

I discovered the reason behind the errors I was experiencing.

Initially, I tried running the {{BundledJarExample}} as follows.

{code}
$ java -cp $HADOOP_CONF_DIR:$MY_APP_BUNDLED_JAR \
  org.apache.twill.example.yarn.BundledJarExample \
  $ZOOKEEPER_ENSEMBLE \
  $HOME/my-app.jar \
  echo.main \
  arg1 arg2 arg3
{code}

I discovered two problems.

# The bundle jar path (e.g. {{$HOME/my-app.jar}}) will be used as both the path 
to find the jar on the local filesystem and as the path to find the jar in the 
unpacked, localized archive from within YARN. So, without changing 
{{BundledJarExample}} or {{BundledJarRunner}}, the easiest way of meeting both 
these criteria is to make sure your bundle jar is in the current working 
directory.
# {{BundledJarExample}} actually takes *4* mandatory arguments, not just 3. You 
must specify the ZooKeeper ensemble, the bundle jar, *a library directory*, and 
a main class. Once I added the library directory argument, it worked. It looks 
like {{BundledJarExample}} needs to be updated to match the arguments 
{{BundledJarRunner}} accepts.

My final, working command was this.

{code}
$ java -cp $HADOOP_CONF_DIR:$MY_APP_BUNDLED_JAR \
  org.apache.twill.example.yarn.BundledJarExample \
  $ZOOKEEPER_ENSEMBLE \
  my-app.jar \
  . \
  echo.main \
  arg1 arg2 arg3
{code}

> Investigate NPE in Bundle jar app
> ---------------------------------
>
>                 Key: TWILL-65
>                 URL: https://issues.apache.org/jira/browse/TWILL-65
>             Project: Apache Twill
>          Issue Type: Bug
>          Components: ext
>            Reporter: Terence Yim
>
> See the mail
> http://s.apache.org/z0z



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to