Description
This is a packing issue. Since a hsqldb jar is not packed in the distribution tarball, sqoop-metastore fails with the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/hsqldb/Server at org.apache.sqoop.metastore.hsqldb.HsqldbMetaStore.start(HsqldbMetaStore.java:111) at org.apache.sqoop.tool.MetastoreTool.run(MetastoreTool.java:57) at org.apache.sqoop.Sqoop.run(Sqoop.java:145) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229) at org.apache.sqoop.Sqoop.main(Sqoop.java:238) at com.cloudera.sqoop.Sqoop.main(Sqoop.java:57) Caused by: java.lang.ClassNotFoundException: org.hsqldb.Server at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 9 more
To reproduce the issue, please do the following:
1) checkout sqoop trunk
2) ant clean tar
3) cd build/sqoop-1.4.2-incubating-SNAPSHOT.bin__hadoop-0.23
4) ./bin/sqoop metastore
This may be not an issue if a hsqldb jar is already installed by another project and therefore exists in classpath. For example, CDH3 installs a hsqldb jar in /usr/lib/hadoop/lib. However, it is not always true in all distributions (e.g. CDH4).
The fix seems to include a hsqldb jar in the distribution tarball.
There is also a bigtop jira BIGTOP-639 regarding this issue.