You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Anandha L Ranganathan <an...@gmail.com> on 2013/02/08 20:32:07 UTC

antlr problem while unit testing

I am facing the problem  while running unit tests using command line.

I modified the code and started testing it started throwing an exception.


The  command I used was,

ant test -Dtestcase=TestCliDriver -Dqfile=alter1.q.

I do have both antlr-running 3.1 and 3.4 version



  </properties>
  <error message="org.antlr.runtime.Lexer.&lt;init&gt;(Lorg/antlr/runtime/CharStream;Lorg/antlr/runtime/RecognizerSharedState;)V"
type="java.lang.NoSuchMethodError">java.lang.NoSuchMethodError:
org.antlr.runtime.Lexer.&lt;init&gt;(Lorg/antlr/runtime/CharStream;Lorg/antlr/runtime/RecognizerSharedState;)V

        at org.apache.hadoop.hive.ql.parse.HiveLexer.&lt;init&gt;(HiveLexer.java:552)
        at org.apache.hadoop.hive.ql.parse.HiveLexer.&lt;init&gt;(HiveLexer.java:549)
        at org.apache.hadoop.hive.ql.parse.ParseDriver$HiveLexerX.&lt;init&gt;(ParseDriver.java:264)

        at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:435)
        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:416)
        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:335)

        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:898)
        at org.apache.hadoop.hive.ql.QTestUtil.runLoadCmd(QTestUtil.java:530)
        at org.apache.hadoop.hive.ql.QTestUtil.createSources(QTestUtil.java:577)

        at org.apache.hadoop.hive.cli.TestCliDriver.&lt;clinit&gt;(TestCliDriver.java:49)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:186)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:373)

        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1052)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:906)
</error>

  <system-out><![CDATA[]]></system-out>
  <system-err><![CDATA[Hive history
file=/home/analog76/sourcecode/hive/trunk/build/ql/tmp/hive_job_log_analog76_201302080827_2054244118.txt

Hive history file=/home/analog76/sourcecode/hive/trunk/build/ql/tmp/hive_job_log_analog76_201302080827_1750183265.txt
]]></system-err>



It works fine in eclipse and I  am able to run or debug  the unit test
cases. But when I run it in command line it gives  problem.

Re: antlr problem while unit testing

Posted by Anandha L Ranganathan <an...@gmail.com>.
Thanks Thiru. It works fine.



Thanks
Anand

On Fri, Feb 8, 2013 at 11:43 AM, Thiruvel Thirumoolan <
thiruvel@yahoo-inc.com> wrote:

> You want to try it after an 'ant very-clean package'. [A related JIRA -
> HIVE-2439].
>
> On 2/8/13 11:32 AM, "Anandha L Ranganathan" <an...@gmail.com> wrote:
>
> >I am facing the problem  while running unit tests using command line.
> >
> >I modified the code and started testing it started throwing an exception.
> >
> >
> >The  command I used was,
> >
> >ant test -Dtestcase=TestCliDriver -Dqfile=alter1.q.
> >
> >I do have both antlr-running 3.1 and 3.4 version
> >
> >
> >
> >  </properties>
> >  <error
> >message="org.antlr.runtime.Lexer.&lt;init&gt;(Lorg/antlr/runtime/CharStrea
> >m;Lorg/antlr/runtime/RecognizerSharedState;)V"
> >type="java.lang.NoSuchMethodError">java.lang.NoSuchMethodError:
> >org.antlr.runtime.Lexer.&lt;init&gt;(Lorg/antlr/runtime/CharStream;Lorg/an
> >tlr/runtime/RecognizerSharedState;)V
> >
> >        at
> >org.apache.hadoop.hive.ql.parse.HiveLexer.&lt;init&gt;(HiveLexer.java:552)
> >        at
> >org.apache.hadoop.hive.ql.parse.HiveLexer.&lt;init&gt;(HiveLexer.java:549)
> >        at
> >org.apache.hadoop.hive.ql.parse.ParseDriver$HiveLexerX.&lt;init&gt;(ParseD
> >river.java:264)
> >
> >        at
> >org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:435)
> >        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:416)
> >        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:335)
> >
> >        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:898)
> >        at
> >org.apache.hadoop.hive.ql.QTestUtil.runLoadCmd(QTestUtil.java:530)
> >        at
> >org.apache.hadoop.hive.ql.QTestUtil.createSources(QTestUtil.java:577)
> >
> >        at
> >org.apache.hadoop.hive.cli.TestCliDriver.&lt;clinit&gt;(TestCliDriver.java
> >:49)
> >        at java.lang.Class.forName0(Native Method)
> >        at java.lang.Class.forName(Class.java:186)
> >        at
> >org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTest
> >Runner.java:373)
> >
> >        at
> >org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitT
> >estRunner.java:1052)
> >        at
> >org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTes
> >tRunner.java:906)
> ></error>
> >
> >  <system-out><![CDATA[]]></system-out>
> >  <system-err><![CDATA[Hive history
> >file=/home/analog76/sourcecode/hive/trunk/build/ql/tmp/hive_job_log_analog
> >76_201302080827_2054244118.txt
> >
> >Hive history
> >file=/home/analog76/sourcecode/hive/trunk/build/ql/tmp/hive_job_log_analog
> >76_201302080827_1750183265.txt
> >]]></system-err>
> >
> >
> >
> >It works fine in eclipse and I  am able to run or debug  the unit test
> >cases. But when I run it in command line it gives  problem.
>
>

Re: antlr problem while unit testing

Posted by Thiruvel Thirumoolan <th...@yahoo-inc.com>.
You want to try it after an 'ant very-clean package'. [A related JIRA -
HIVE-2439].

On 2/8/13 11:32 AM, "Anandha L Ranganathan" <an...@gmail.com> wrote:

>I am facing the problem  while running unit tests using command line.
>
>I modified the code and started testing it started throwing an exception.
>
>
>The  command I used was,
>
>ant test -Dtestcase=TestCliDriver -Dqfile=alter1.q.
>
>I do have both antlr-running 3.1 and 3.4 version
>
>
>
>  </properties>
>  <error 
>message="org.antlr.runtime.Lexer.&lt;init&gt;(Lorg/antlr/runtime/CharStrea
>m;Lorg/antlr/runtime/RecognizerSharedState;)V"
>type="java.lang.NoSuchMethodError">java.lang.NoSuchMethodError:
>org.antlr.runtime.Lexer.&lt;init&gt;(Lorg/antlr/runtime/CharStream;Lorg/an
>tlr/runtime/RecognizerSharedState;)V
>
>        at 
>org.apache.hadoop.hive.ql.parse.HiveLexer.&lt;init&gt;(HiveLexer.java:552)
>        at 
>org.apache.hadoop.hive.ql.parse.HiveLexer.&lt;init&gt;(HiveLexer.java:549)
>        at 
>org.apache.hadoop.hive.ql.parse.ParseDriver$HiveLexerX.&lt;init&gt;(ParseD
>river.java:264)
>
>        at 
>org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:435)
>        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:416)
>        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:335)
>
>        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:898)
>        at 
>org.apache.hadoop.hive.ql.QTestUtil.runLoadCmd(QTestUtil.java:530)
>        at 
>org.apache.hadoop.hive.ql.QTestUtil.createSources(QTestUtil.java:577)
>
>        at 
>org.apache.hadoop.hive.cli.TestCliDriver.&lt;clinit&gt;(TestCliDriver.java
>:49)
>        at java.lang.Class.forName0(Native Method)
>        at java.lang.Class.forName(Class.java:186)
>        at 
>org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTest
>Runner.java:373)
>
>        at 
>org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitT
>estRunner.java:1052)
>        at 
>org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTes
>tRunner.java:906)
></error>
>
>  <system-out><![CDATA[]]></system-out>
>  <system-err><![CDATA[Hive history
>file=/home/analog76/sourcecode/hive/trunk/build/ql/tmp/hive_job_log_analog
>76_201302080827_2054244118.txt
>
>Hive history 
>file=/home/analog76/sourcecode/hive/trunk/build/ql/tmp/hive_job_log_analog
>76_201302080827_1750183265.txt
>]]></system-err>
>
>
>
>It works fine in eclipse and I  am able to run or debug  the unit test
>cases. But when I run it in command line it gives  problem.