Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Issue with PigServer: java.lang.NoSuchFieldError: name


Copy link to this message
-
Re: Issue with PigServer: java.lang.NoSuchFieldError: name
Do you have another version of antlr jar in your classpath (different
from version used in pig)? I have seen this problem earlier, and it
seemed to go away when I removed unnecessary jars from classpath
(including antlr).

Thanks,
Thejas
On 5/31/12 7:35 AM, Etienne Dumoulin wrote:
> Hi all,
>
> I try to use pigserver for the first time, I have an exception
> and I did not find much about it on the official website and google.
>
> I have a problem to launch a query from a Java program.
> The query is tested and works in command line mode.
>
>
> The java code:
>
> try {
>              if(distributed){
>                  pig = new PigServer(ExecType.MAPREDUCE);
>              }else{
>                  pig = new PigServer(ExecType.LOCAL);
>              }
>              logger.debug("Pig query to launch: \n"+query);
>              pig.registerQuery(query);
>              logger.debug("Store process...");
>              pig.store("A",
> "hbase://"+tableNameTo,"org.apache.pig.backend.hadoop.hbase.HBaseStorage('"+hbaseFeat+"')");
>
>          } catch (ExecException e) {....
>
> The logs when tested in local mode:
> .
> .
> [May 31 15:15:04] DEBUG (HBaseStatement.java:407) - Pig query to launch:
> A = LOAD '/tmp/hbase/test' USING PigStorage('|');
> Exception in thread "main" java.lang.NoSuchFieldError: name
>          at
> org.apache.pig.parser.QueryParserStringStream.<init>(QueryParserStringStream.java:32)
>          at
> org.apache.pig.parser.QueryParserDriver.tokenize(QueryParserDriver.java:198)
>          at
> org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:166)
>          at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1589)
>          at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1540)
>          at org.apache.pig.PigServer.registerQuery(PigServer.java:540)
>          at org.apache.pig.PigServer.registerQuery(PigServer.java:553)
> .
> .
>
> Thanks,
>
> �tienne
>