0

When I read a file from hdfs by giving it proper path the file is read successfully but when I try to use transform operator of jaql it throws an exception as given below and if I try to execute the code on JAQL shell then an exception is thrown of job.jar but even after adding the jar the exception is still thrown. if anybody knows that somehow JAQL is not configured properly with existing hadoop cluster or the exception is due to some other cause?


My code is:

        jaql.setQueryString("read(lines('hdfs://hadoopserver:54310/dbreports/reports.json'," +
                                    "{format: 'org.apache.hadoop.mapred.TextInputFormat',converter: 'com.ibm.jaql.io.hadoop.converter.FromJsonTextConverter'})) -> transform $.store_number;"); 
                System.out.println("jaql running successfully...."); 
                JsonValue jv = jaql.evaluate();
                System.out.println("value is "+jv);

        when run it throws an exception as:


        Exception in thread "Thread-38" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod
            at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:295)
        Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod
            at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
            at sbt.PlayCommands$$anonfun$61$$anonfun$63$$anon$2$$anonfun$loadClass$1.apply(PlayCommands.scala:563)
            at sbt.PlayCommands$$anonfun$61$$anonfun$63$$anon$2$$anonfun$loadClass$1.apply(PlayCommands.scala:563)
            at scala.Option.map(Option.scala:133)
            at sbt.PlayCommands$$anonfun$61$$anonfun$63$$anon$2.loadClass(PlayCommands.scala:563)
            ... 1 more
        java.io.IOException: Job failed!
            ..........

Do anybody knows what it is that i'm missing?

Charles
  • 50,943
  • 13
  • 104
  • 142
Harmin
  • 11
  • 2

0 Answers0