使用sqoop将mysql数据导入hbase报错

Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject
        at org.apache.sqoop.util.SqoopJsonUtil.getJsonStringforMap(SqoopJsonUtil.java:43)
        at org.apache.sqoop.SqoopOptions.writeProperties(SqoopOptions.java:785)
        at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.createInternal(HsqldbJobStorage.java:399)
        at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.create(HsqldbJobStorage.java:379)
        at org.apache.sqoop.tool.JobTool.createJob(JobTool.java:181)
        at org.apache.sqoop.tool.JobTool.run(JobTool.java:294)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
Caused by: java.lang.ClassNotFoundException: org.json.JSONObject
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 12 more

这是因为sqoop缺少java-json.jar包

点击下载

 http://www.java2s.com/Code/Jar/j/Downloadjavajsonjar.htm

上传linux上

unzip java.json.jar.zip

将java-json.jar放在sqoop的目录下的lib中

你可能感兴趣的:(Sqoop,sqoop,jar,mysql,hbase,大数据)