Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> java.lang.NoClassDefFoundError: dk/brics/automaton/Automaton


Copy link to this message
-
java.lang.NoClassDefFoundError: dk/brics/automaton/Automaton
I am using PigServer to run a pig script that communicates with a
psuedo-distributed hadoop installation on my localbox. I have included
*-site.xml in CLASSPATH.
While running the pig script i get the following exception
Exception in thread "main" java.lang.NoClassDefFoundError:
dk/brics/automaton/Automaton
    at
org.apache.pig.impl.util.JarManager$DefaultPigPackages.<clinit>(JarManager.java:99)
    at org.apache.pig.impl.util.JarManager.createJar(JarManager.java:136)
    at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:517)
    at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(JobControlCompiler.java:294)
    at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:177)
Code
===PigServer pigServer = new PigServer(ExecType.MAPREDUCE);
      Data data = Storage.resetData(pigServer);
      Collection<Tuple> list = new ArrayList<Tuple>();
      for (int i = 0; i < ROW_COUNT; i++) {
        Tuple tuple = TupleFactory.getInstance().newTuple(COLUMN_COUNT);
        for (int j = 0; j < COLUMN_COUNT; j++) {
          tuple.set(j, "a" + i + "_" + j);
        }
        list.add(tuple);
      }
      pigServer.setBatchOn();
      pigServer.registerQuery("A = LOAD 'in' USING mock.Storage();");
      pigServer.deleteFile(out);
      if (pigServer.executeBatch().get(0).getStatus() !JOB_STATUS.COMPLETED) {
        throw new RuntimeException("Job failed",
pigServer.executeBatch().get(0).getException());
      }

==
Does PigServer expect anyother resources in CLASSPATH.
Above pig script works fine with  ExecType.LOCAL
--
Deepak
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB