Hive
  1. Hive
  2. HIVE-3377

ant model-jar command fails in metastore

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: Metastore
    • Labels:

      Description

      Running "ant model-jar" command to set up eclipse dev environment from the following wiki:

      https://cwiki.apache.org/Hive/gettingstarted-eclipsesetup.html

      fails with the following message:

      BUILD FAILED
      **/workspace/hive-trunk/metastore/build.xml:22: The following error occurred while executing this line:
      **/workspace/hive-trunk/build-common.xml:112: Problem: failed to create task or type osfamily
      Cause: The name is undefined.
      Action: Check the spelling.
      Action: Check that any custom tasks/types have been declared.
      Action: Check that any <presetdef>/<macrodef> declarations have taken place.

        Activity

        Hide
        Xu Ji added a comment -

        The same error on my env.
        Anyone looked into this?

        Show
        Xu Ji added a comment - The same error on my env. Anyone looked into this?
        Hide
        Krishna added a comment -

        Is there a work-around to this? I'm having the same problem.

        Show
        Krishna added a comment - Is there a work-around to this? I'm having the same problem.
        Hide
        Kevin Wilfong added a comment -

        Deleting line 112 in build-common.xml seems to help. I don't know if the build will work in all operating systems without it though.

        Show
        Kevin Wilfong added a comment - Deleting line 112 in build-common.xml seems to help. I don't know if the build will work in all operating systems without it though.
        Hide
        Krishna added a comment -

        Line # 112 is blank; here are line numbers 105 - 120. please let me know which line to delete.

        105 <!-- include contrib on local classpath, but not on cluster -->
        106 <!-- https://reviews.facebook.net/D2133#comment-47 -->
        107 <path id="test.local.classpath">
        108 <path refid="$

        {test.classpath.id}

        "/>
        109 <fileset dir="$

        {hive.root}

        /build/ivy/lib/test" includes="hive-contrib*.jar" erroronmissingdir="false"/>
        110 </path>
        111
        112
        113 <loadproperties srcfile="$

        {ivy.conf.dir}

        /libraries.properties"/>
        114
        115 <osfamily property="os.family"/>
        116
        117 <condition property="offline">
        118 <istrue value="$

        {is-offline}

        "/>
        119 </condition>
        120 <import file="build-offline.xml"/>

        Show
        Krishna added a comment - Line # 112 is blank; here are line numbers 105 - 120. please let me know which line to delete. 105 <!-- include contrib on local classpath, but not on cluster --> 106 <!-- https://reviews.facebook.net/D2133#comment-47 --> 107 <path id="test.local.classpath"> 108 <path refid="$ {test.classpath.id} "/> 109 <fileset dir="$ {hive.root} /build/ivy/lib/test" includes="hive-contrib*.jar" erroronmissingdir="false"/> 110 </path> 111 112 113 <loadproperties srcfile="$ {ivy.conf.dir} /libraries.properties"/> 114 115 <osfamily property="os.family"/> 116 117 <condition property="offline"> 118 <istrue value="$ {is-offline} "/> 119 </condition> 120 <import file="build-offline.xml"/>
        Hide
        Kevin Wilfong added a comment -

        115 then

        Show
        Kevin Wilfong added a comment - 115 then
        Hide
        Krishna added a comment -

        Thanks, that worked but next command "ant gen-test" failed.
        Here is the error message, any thoughts?

        /opt/hive-trunk$ ant get-test
        Buildfile: /opt/hive-trunk/build.xml

        BUILD FAILED
        Target "get-test" does not exist in the project "hive".

        Total time: 1 second

        Show
        Krishna added a comment - Thanks, that worked but next command "ant gen-test" failed. Here is the error message, any thoughts? /opt/hive-trunk$ ant get-test Buildfile: /opt/hive-trunk/build.xml BUILD FAILED Target "get-test" does not exist in the project "hive". Total time: 1 second
        Hide
        Kevin Wilfong added a comment -

        Sorry, that one's new to me.

        Show
        Kevin Wilfong added a comment - Sorry, that one's new to me.
        Hide
        Krishna added a comment -

        If someone could share how Eclipse was setup, that would be great. I followed following steps but last command fails with error message "get-test" does not exists in the project "hive" - please help.

        $ ant clean package eclipse-files
        $ cd metastore
        $ ant model-jar
        $ cd ..
        $ ant gen-test ---> Error with the command

        Show
        Krishna added a comment - If someone could share how Eclipse was setup, that would be great. I followed following steps but last command fails with error message "get-test" does not exists in the project "hive" - please help. $ ant clean package eclipse-files $ cd metastore $ ant model-jar $ cd .. $ ant gen-test ---> Error with the command
        Hide
        Krishna added a comment -

        Looks like the issue was because I checked-out trunk to /opt dir. I was able setup Eclipse successfully after checking out to /home/<user> dir. To double-check I also ran the commands as "sudo" on /opt/hive-trunk and that also worked without issues. Looks like the error was generated because of permissions issue on /opt dir.

        Show
        Krishna added a comment - Looks like the issue was because I checked-out trunk to /opt dir. I was able setup Eclipse successfully after checking out to /home/<user> dir. To double-check I also ran the commands as "sudo" on /opt/hive-trunk and that also worked without issues. Looks like the error was generated because of permissions issue on /opt dir.
        Hide
        Krishna added a comment -

        Note that I did remove the line from build-common.xml file as per Kevin's suggestion.

        Show
        Krishna added a comment - Note that I did remove the line from build-common.xml file as per Kevin's suggestion.
        Hide
        Xu Ji added a comment -

        Krish, are you sure you were using command "ant gen-test" instead of "ant get-test"?
        I built successfully after I removed line #115 as Kevin suggested.
        Thanks for Kevin's information.

        Show
        Xu Ji added a comment - Krish, are you sure you were using command "ant gen-test" instead of "ant get-test"? I built successfully after I removed line #115 as Kevin suggested. Thanks for Kevin's information.
        Hide
        Krishna added a comment -

        Xu, that might have been the issue.

        Show
        Krishna added a comment - Xu, that might have been the issue.
        Hide
        Darren Yin added a comment -

        The problem likely comes from ant-contrib not being loaded by ant when ant model-jar is run. If you want it to run without deleting that line, you may be able to run something like

        ant -lib /usr/share/java model-jar

        assuming that you have the ant-contrib jar sitting in /usr/share/java.

        Show
        Darren Yin added a comment - The problem likely comes from ant-contrib not being loaded by ant when ant model-jar is run. If you want it to run without deleting that line, you may be able to run something like ant -lib /usr/share/java model-jar assuming that you have the ant-contrib jar sitting in /usr/share/java.
        Hide
        Darren Yin added a comment -

        Actually, that may not cover all of it. I believe this bug report may be somewhat related (both issues with ant-contrib not being properly imported): https://issues.apache.org/jira/browse/HIVE-2904

        Show
        Darren Yin added a comment - Actually, that may not cover all of it. I believe this bug report may be somewhat related (both issues with ant-contrib not being properly imported): https://issues.apache.org/jira/browse/HIVE-2904
        Hide
        Carl Steinbach added a comment -

        The directions on the wiki are out of date. You no longer need to run the model-jar and gen-test Ant targets. Doing the following should suffice:

        $ ant clean package eclipse-files

        Show
        Carl Steinbach added a comment - The directions on the wiki are out of date. You no longer need to run the model-jar and gen-test Ant targets. Doing the following should suffice: $ ant clean package eclipse-files
        Hide
        Carl Steinbach added a comment -

        I updated the instructions on the wiki.

        Resolving this ticket as WONTFIX since we no longer support running Ant from submodule directories.

        Show
        Carl Steinbach added a comment - I updated the instructions on the wiki. Resolving this ticket as WONTFIX since we no longer support running Ant from submodule directories.

          People

          • Assignee:
            Unassigned
            Reporter:
            Vandana Ayyalasomayajula
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development