Topic
  • 3 replies
  • Latest Post - ‏2012-10-12T10:24:14Z by SystemAdmin
SystemAdmin
SystemAdmin
603 Posts

Pinned topic Run single node application in BigInsights and emtpy args

‏2012-10-11T09:59:40Z |
Hello,
I've a little application, a web scraper, designed to work as a normal Java application from console but to save the execution results in HDFS when possible. As a normal application, it works without need to user interaction and produce an output file.
This application requires a parameter, that is a json configuration file, and this file in turns tell it where to find another file, a Javascript file run through Rhino. There are two problems trying to do so:
1-when the application is deployed and run the web console asks for the path of the input file, I took the example from the demo application WordCounter, but then this parameter is apparently lost and the argshttp://] value received by main() is an empty vector. I wrote a little application to see the args[ content and it seems to be always empty despite the execution parameters asked in the web console. How can I pass parameters ? Then, is there a way to deploy a file in hdfs working directory of the application?

2-When I deploy the application from Eclipse it asks for a jar saying "- Add .jar archives for the java action ", so I have to:
*from the project use export->jar file and export the application in a jar external to the application folder in the workspace
*from the file manager copy this file to the project folder
*refresh the project to make Eclipse see this Jar
*use the BI application publish wizard and select this file when asked
this way the application is deployed, but I gues that's not the way it's supposed to publish an application. Is there a easier way?
Updated on 2012-10-12T10:24:14Z at 2012-10-12T10:24:14Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    603 Posts

    Re: Run single node application in BigInsights and emtpy args

    ‏2012-10-11T12:52:09Z  
    The problem 1 is solved, in application.xml there was the parameter request, but in workflow.xml there was no <arg> tag using it. In the WordCount application there's no such a tag, maybe because it's a mapreduce application and not a Java-main one, although it has a main method too.
  • tfriedr
    tfriedr
    28 Posts

    Re: Run single node application in BigInsights and emtpy args

    ‏2012-10-11T23:27:26Z  
    The problem 1 is solved, in application.xml there was the parameter request, but in workflow.xml there was no <arg> tag using it. In the WordCount application there's no such a tag, maybe because it's a mapreduce application and not a Java-main one, although it has a main method too.
    The Application publish wizard provides a way to create a Jar during publish. On the last page of the publish wizard, there is a Create Jar button which will launch the Jar export wizard from Eclipse. To save the Jar file within the project, set the Jar file location to <project_name>/<jar_name>. Once the Jar was created, back in the publish wizard, click Add... to add the Jar to the application.
  • SystemAdmin
    SystemAdmin
    603 Posts

    Re: Run single node application in BigInsights and emtpy args

    ‏2012-10-12T10:24:14Z  
    Ok, thanks.
    I saw there's a REST interface to publish and run applications, so I could use it to make the publication a quick process, but it needs a zip file. Is that the BIApp.zip file generated by Eclipse? Is there a documentation about it' structure ?