You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Aaron Sun <aa...@gmail.com> on 2012/02/15 20:52:42 UTC

Running hive in eclipse

Hi Team,

I am trying to run and debug hive in eclipse. I checked out release-0.8.0
1215012 from the SVN repository and built the project with thrift and fb303
library installed correctly. The building process returned "Build
Successfully".

Then I tried to launch the cli by running CliDriver.java as a Java
Application, and it returned errors as

"""
Exception in thread "main" java.lang.RuntimeException: Failed to load Hive
builtin functions
at
org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:190)
at
org.apache.hadoop.hive.cli.CliSessionState.<init>(CliSessionState.java:81)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:576)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:554)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:131)
at java.util.jar.JarFile.<init>(JarFile.java:150)
at java.util.jar.JarFile.<init>(JarFile.java:87)
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:90)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:66)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:71)
at
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
at
sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
at java.net.URL.openStream(URL.java:1029)
at
org.apache.hadoop.hive.ql.exec.FunctionRegistry.registerFunctionsFromPluginJar(FunctionRegistry.java:1194)
at
org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:187)
... 3 more
"""
I looked over the build.xml under ./builtins directory, and noticed that
the compile and jar targets are both commented, and no jar is generated for
builtins

<target name="compile" depends="init, setup">
    <echo message="Project: ${ant.project.name}"/>
  <!-- defer compilation until package phase -->
</target>

<target name="jar" depends="init">
    <echo message="Project: ${ant.project.name}"/>
    <!-- defer compilation until package phase -->
</target>

I then manually changed the build.xml for "compile" part as follows and
rebuilt the project:
  <target name="compile" depends="init, setup">
    <echo message="Project: ${ant.project.name}"/>
  <javac
       encoding="${build.encoding}"
       srcdir="${src.dir}"
       includes="**/*.java"
       destdir="${build.classes}"
       debug="${javac.debug}"
       deprecation="${javac.deprecation}"
       includeantruntime="false">
        <compilerarg line="${javac.args} ${javac.args.warnings}" />
        <classpath refid="classpath"/>
  </javac>
  </target>

Now the 'hive-buitins-0.8.0-SNAPSHOT.jar' is under the .build/buitins
directory. However, I am still getting the same error message as "Failed to
load Hive builtin functions". Could someone kindly let me know what is the
problem and how I should run cli correctly in eclipse?

Thanks
Aaron

Re: Running hive in eclipse

Posted by Alexis De La Cruz Toledo <al...@gmail.com>.
I has the same problem.
Can anyone help us?

El 15 de febrero de 2012 13:52, Aaron Sun <aa...@gmail.com> escribió:

> Hi Team,
>
> I am trying to run and debug hive in eclipse. I checked out release-0.8.0
> 1215012 from the SVN repository and built the project with thrift and fb303
> library installed correctly. The building process returned "Build
> Successfully".
>
> Then I tried to launch the cli by running CliDriver.java as a Java
> Application, and it returned errors as
>
> """
> Exception in thread "main" java.lang.RuntimeException: Failed to load Hive
> builtin functions
> at
>
> org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:190)
> at
> org.apache.hadoop.hive.cli.CliSessionState.<init>(CliSessionState.java:81)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:576)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:554)
> Caused by: java.util.zip.ZipException: error in opening zip file
> at java.util.zip.ZipFile.open(Native Method)
> at java.util.zip.ZipFile.<init>(ZipFile.java:131)
> at java.util.jar.JarFile.<init>(JarFile.java:150)
> at java.util.jar.JarFile.<init>(JarFile.java:87)
> at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:90)
> at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:66)
> at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:71)
> at
>
> sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
> at
>
> sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
> at java.net.URL.openStream(URL.java:1029)
> at
>
> org.apache.hadoop.hive.ql.exec.FunctionRegistry.registerFunctionsFromPluginJar(FunctionRegistry.java:1194)
> at
>
> org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:187)
> ... 3 more
> """
> I looked over the build.xml under ./builtins directory, and noticed that
> the compile and jar targets are both commented, and no jar is generated for
> builtins
>
> <target name="compile" depends="init, setup">
>    <echo message="Project: ${ant.project.name}"/>
>  <!-- defer compilation until package phase -->
> </target>
>
> <target name="jar" depends="init">
>    <echo message="Project: ${ant.project.name}"/>
>    <!-- defer compilation until package phase -->
> </target>
>
> I then manually changed the build.xml for "compile" part as follows and
> rebuilt the project:
>  <target name="compile" depends="init, setup">
>    <echo message="Project: ${ant.project.name}"/>
>  <javac
>       encoding="${build.encoding}"
>       srcdir="${src.dir}"
>       includes="**/*.java"
>       destdir="${build.classes}"
>       debug="${javac.debug}"
>       deprecation="${javac.deprecation}"
>       includeantruntime="false">
>        <compilerarg line="${javac.args} ${javac.args.warnings}" />
>        <classpath refid="classpath"/>
>  </javac>
>  </target>
>
> Now the 'hive-buitins-0.8.0-SNAPSHOT.jar' is under the .build/buitins
> directory. However, I am still getting the same error message as "Failed to
> load Hive builtin functions". Could someone kindly let me know what is the
> problem and how I should run cli correctly in eclipse?
>
> Thanks
> Aaron
>



-- 
Ing. Alexis de la Cruz Toledo.
*Av. Instituto Politécnico Nacional No. 2508 Col. San Pedro Zacatenco. México,
D.F, 07360 *
*CINVESTAV, DF.*

Re: Running hive in eclipse

Posted by Carl Steinbach <ca...@cloudera.com>.
Hi Aaron,

You'll need to either check out trunk, or else apply HIVE-2673 to the
release-0.8-r2 branch.

Then follow the directions here:
https://cwiki.apache.org/confluence/display/Hive/GettingStarted+EclipseSetup

Then install the Datanucleus Eclipse Plugin:
http://www.datanucleus.org/products/accessplatform/guides/eclipse/index.html

Run the Datanucleus Enhancer on the Hive project that you have imported
into Eclipse.

At this point you should be able to start the CLI using the Eclipse launch
configuration.

Thanks.

Carl

On Wed, Feb 15, 2012 at 7:07 PM, Ashish Sharma
<th...@gmail.com>wrote:

> Hello there  ,
> https://issues.apache.org/jira/browse/HIVE-2673, this might be helpful.
>
>
>
> On Thu, Feb 16, 2012 at 1:22 AM, Aaron Sun <aa...@gmail.com> wrote:
>
> > Hi Team,
> >
> > I am trying to run and debug hive in eclipse. I checked out release-0.8.0
> > 1215012 from the SVN repository and built the project with thrift and
> fb303
> > library installed correctly. The building process returned "Build
> > Successfully".
> >
> > Then I tried to launch the cli by running CliDriver.java as a Java
> > Application, and it returned errors as
> >
> > """
> > Exception in thread "main" java.lang.RuntimeException: Failed to load
> Hive
> > builtin functions
> > at
> >
> >
> org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:190)
> > at
> >
> org.apache.hadoop.hive.cli.CliSessionState.<init>(CliSessionState.java:81)
> > at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:576)
> > at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:554)
> > Caused by: java.util.zip.ZipException: error in opening zip file
> > at java.util.zip.ZipFile.open(Native Method)
> > at java.util.zip.ZipFile.<init>(ZipFile.java:131)
> > at java.util.jar.JarFile.<init>(JarFile.java:150)
> > at java.util.jar.JarFile.<init>(JarFile.java:87)
> > at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:90)
> > at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:66)
> > at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:71)
> > at
> >
> >
> sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
> > at
> >
> >
> sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
> > at java.net.URL.openStream(URL.java:1029)
> > at
> >
> >
> org.apache.hadoop.hive.ql.exec.FunctionRegistry.registerFunctionsFromPluginJar(FunctionRegistry.java:1194)
> > at
> >
> >
> org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:187)
> > ... 3 more
> > """
> > I looked over the build.xml under ./builtins directory, and noticed that
> > the compile and jar targets are both commented, and no jar is generated
> for
> > builtins
> >
> > <target name="compile" depends="init, setup">
> >    <echo message="Project: ${ant.project.name}"/>
> >  <!-- defer compilation until package phase -->
> > </target>
> >
> > <target name="jar" depends="init">
> >    <echo message="Project: ${ant.project.name}"/>
> >    <!-- defer compilation until package phase -->
> > </target>
> >
> > I then manually changed the build.xml for "compile" part as follows and
> > rebuilt the project:
> >  <target name="compile" depends="init, setup">
> >    <echo message="Project: ${ant.project.name}"/>
> >  <javac
> >       encoding="${build.encoding}"
> >       srcdir="${src.dir}"
> >       includes="**/*.java"
> >       destdir="${build.classes}"
> >       debug="${javac.debug}"
> >       deprecation="${javac.deprecation}"
> >       includeantruntime="false">
> >        <compilerarg line="${javac.args} ${javac.args.warnings}" />
> >        <classpath refid="classpath"/>
> >  </javac>
> >  </target>
> >
> > Now the 'hive-buitins-0.8.0-SNAPSHOT.jar' is under the .build/buitins
> > directory. However, I am still getting the same error message as "Failed
> to
> > load Hive builtin functions". Could someone kindly let me know what is
> the
> > problem and how I should run cli correctly in eclipse?
> >
> > Thanks
> > Aaron
> >
>

Re: Running hive in eclipse

Posted by Ashish Sharma <th...@gmail.com>.
Hello there  ,
https://issues.apache.org/jira/browse/HIVE-2673, this might be helpful.



On Thu, Feb 16, 2012 at 1:22 AM, Aaron Sun <aa...@gmail.com> wrote:

> Hi Team,
>
> I am trying to run and debug hive in eclipse. I checked out release-0.8.0
> 1215012 from the SVN repository and built the project with thrift and fb303
> library installed correctly. The building process returned "Build
> Successfully".
>
> Then I tried to launch the cli by running CliDriver.java as a Java
> Application, and it returned errors as
>
> """
> Exception in thread "main" java.lang.RuntimeException: Failed to load Hive
> builtin functions
> at
>
> org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:190)
> at
> org.apache.hadoop.hive.cli.CliSessionState.<init>(CliSessionState.java:81)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:576)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:554)
> Caused by: java.util.zip.ZipException: error in opening zip file
> at java.util.zip.ZipFile.open(Native Method)
> at java.util.zip.ZipFile.<init>(ZipFile.java:131)
> at java.util.jar.JarFile.<init>(JarFile.java:150)
> at java.util.jar.JarFile.<init>(JarFile.java:87)
> at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:90)
> at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:66)
> at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:71)
> at
>
> sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
> at
>
> sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
> at java.net.URL.openStream(URL.java:1029)
> at
>
> org.apache.hadoop.hive.ql.exec.FunctionRegistry.registerFunctionsFromPluginJar(FunctionRegistry.java:1194)
> at
>
> org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:187)
> ... 3 more
> """
> I looked over the build.xml under ./builtins directory, and noticed that
> the compile and jar targets are both commented, and no jar is generated for
> builtins
>
> <target name="compile" depends="init, setup">
>    <echo message="Project: ${ant.project.name}"/>
>  <!-- defer compilation until package phase -->
> </target>
>
> <target name="jar" depends="init">
>    <echo message="Project: ${ant.project.name}"/>
>    <!-- defer compilation until package phase -->
> </target>
>
> I then manually changed the build.xml for "compile" part as follows and
> rebuilt the project:
>  <target name="compile" depends="init, setup">
>    <echo message="Project: ${ant.project.name}"/>
>  <javac
>       encoding="${build.encoding}"
>       srcdir="${src.dir}"
>       includes="**/*.java"
>       destdir="${build.classes}"
>       debug="${javac.debug}"
>       deprecation="${javac.deprecation}"
>       includeantruntime="false">
>        <compilerarg line="${javac.args} ${javac.args.warnings}" />
>        <classpath refid="classpath"/>
>  </javac>
>  </target>
>
> Now the 'hive-buitins-0.8.0-SNAPSHOT.jar' is under the .build/buitins
> directory. However, I am still getting the same error message as "Failed to
> load Hive builtin functions". Could someone kindly let me know what is the
> problem and how I should run cli correctly in eclipse?
>
> Thanks
> Aaron
>