【Apache Nutch系列】Nutch2.0配置安装异常集锦
1、java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration
- Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration
- at org.apache.gora.hbase.store.HBaseStore.initialize(HBaseStore.java:108)
- at org.apache.gora.store.DataStoreFactory.initializeDataStore(DataStoreFactory.java:102)
- at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:161)
- at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:135)
- at org.apache.nutch.storage.StorageUtils.createWebStore(StorageUtils.java:75)
- at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:221)
- at org.apache.nutch.crawl.Crawler.runTool(Crawler.java:68)
- at org.apache.nutch.crawl.Crawler.run(Crawler.java:136)
- at org.apache.nutch.crawl.Crawler.run(Crawler.java:250)
- at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
- at org.apache.nutch.crawl.Crawler.main(Crawler.java:257)
- Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.HBaseConfiguration
- at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
- at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
- at java.security.AccessController.doPrivileged(Native Method)
- at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
- at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
- ... 11 more
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration
at org.apache.gora.hbase.store.HBaseStore.initialize(HBaseStore.java:108)
at org.apache.gora.store.DataStoreFactory.initializeDataStore(DataStoreFactory.java:102)
at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:161)
at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:135)
at org.apache.nutch.storage.StorageUtils.createWebStore(StorageUtils.java:75)
at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:221)
at org.apache.nutch.crawl.Crawler.runTool(Crawler.java:68)
at org.apache.nutch.crawl.Crawler.run(Crawler.java:136)
at org.apache.nutch.crawl.Crawler.run(Crawler.java:250)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.nutch.crawl.Crawler.main(Crawler.java:257)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.HBaseConfiguration
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 11 more
官方文档说明如下:
- N.B. It's possible to encounter the following exception: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration; this is caused by the fact that sometimes the hbase TEST jar is deployed in the lib dir. To resolve this just copy the lib over from your installed HBase dir into the build lib dir. (This issue is currently in progress).
N.B. It's possible to encounter the following exception: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration; this is caused by the fact that sometimes the hbase TEST jar is deployed in the lib dir. To resolve this just copy the lib over from your installed HBase dir into the build lib dir. (This issue is currently in progress).
解决方法:
我们把$HBASE_HOME/lib下的所有包,拷贝到$NUTCH_HOME/runtime/local/lib目录下。运行即可
2、java.lang.NoSuchMethodError:org.apache.hadoop.hbase.HColumnDescriptor.setMaxVersions(I)V
HBASE官方JIRA BUG编号:HBASE-8273
这个是HBASE-5357引入的问题,原因是HBASE-5357将HColumnDescriptor.setMaxVersions
返回值修改成返回HColumnDescriptor,而不是返回void,所以改变了HColumnDescriptor setMaxVersions
方法的签名。所以它只会得到与Integer.intValue编译仍然不会找到setMaxVersions(INT)
Cloudera 官网说明
- Column family manipulations are binary-incompatible between CDH4.2 and CDH4.0/CDH4.1
- Because of HBASE-5357, code compiled against CDH4.0 and CDH4.1 will fail with java.lang.NoSuchMethodError: org.apache.hadoop.hbase.HColumnDescriptor.setMaxVersions(I)V, if used with the CDH4.2 libraries. The reason is that the setter methods in HColumnDescriptor were modified to return HColumnDescriptor instead of void, which changes their signature. Code that only does data manipulations, using the HTable class, will still work without recompilation.
- Bug: HBASE-8273
- Severity: Medium
- Anticipated Resolution: None planned; use workaround.
- Workaround: Code compiled against CDH4.0 and 4.1 that uses HColumnDescriptor must be recompiled against CDH4.2 in order to work with the CDH4.2 libraries. Code compiled against CDH4.0 and CDH4.1 running with those libraries does not have this problem.
Column family manipulations are binary-incompatible between CDH4.2 and CDH4.0/CDH4.1
Because of HBASE-5357, code compiled against CDH4.0 and CDH4.1 will fail with java.lang.NoSuchMethodError: org.apache.hadoop.hbase.HColumnDescriptor.setMaxVersions(I)V, if used with the CDH4.2 libraries. The reason is that the setter methods in HColumnDescriptor were modified to return HColumnDescriptor instead of void, which changes their signature. Code that only does data manipulations, using the HTable class, will still work without recompilation. Bug: HBASE-8273 Severity: Medium Anticipated Resolution: None planned; use workaround. Workaround: Code compiled against CDH4.0 and 4.1 that uses HColumnDescriptor must be recompiled against CDH4.2 in order to work with the CDH4.2 libraries. Code compiled against CDH4.0 and CDH4.1 running with those libraries does not have this problem.
原因:这边我使用的hadoop和hbase启动是没有问题的,也就是说是gora-hbase插件的问题
解决方法:
将gora-hbase插件中涉及使用到HColumnDescriptor的代码重新编译可解决。
具体要编译那些类后续会列出
3、java.lang.ClassNotFoundException: org.apache.gora.hbase.store.HBaseStore
- hadoop@nutch1:/data/projects/apache-nutch-2.2.1/runtime/local$ bin/nutch crawl urls/seed.txt -dir crawl -depth 3 -topN 5
- Exception in thread "main" java.lang.ClassNotFoundException: org.apache.gora.hbase.store.HBaseStore
- at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
- at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
- at java.security.AccessController.doPrivileged(Native Method)
- at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
- at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
- at java.lang.Class.forName0(Native Method)
- at java.lang.Class.forName(Class.java:188)
- at org.apache.nutch.storage.StorageUtils.getDataStoreClass(StorageUtils.java:89)
- at org.apache.nutch.storage.StorageUtils.createWebStore(StorageUtils.java:73)
- at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:221)
- at org.apache.nutch.crawl.Crawler.runTool(Crawler.java:68)
- at org.apache.nutch.crawl.Crawler.run(Crawler.java:136)
- at org.apache.nutch.crawl.Crawler.run(Crawler.java:250)
- at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
- at org.apache.nutch.crawl.Crawler.main(Crawler.java:257)
hadoop@nutch1:/data/projects/apache-nutch-2.2.1/runtime/local$ bin/nutch crawl urls/seed.txt -dir crawl -depth 3 -topN 5
Exception in thread "main" java.lang.ClassNotFoundException: org.apache.gora.hbase.store.HBaseStore
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at org.apache.nutch.storage.StorageUtils.getDataStoreClass(StorageUtils.java:89)
at org.apache.nutch.storage.StorageUtils.createWebStore(StorageUtils.java:73)
at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:221)
at org.apache.nutch.crawl.Crawler.runTool(Crawler.java:68)
at org.apache.nutch.crawl.Crawler.run(Crawler.java:136)
at org.apache.nutch.crawl.Crawler.run(Crawler.java:250)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.nutch.crawl.Crawler.main(Crawler.java:257)
解决方法:
方法1:下载gora-0.3,然后对该目录下的gora-hbase进行编译生成gora-hbase.jar,然后将jar包放到$NUTCH/runtime/local/lib目录下
方法2:修改$NUTCH_HOME/ivy/ivy.xml
将<dependency org="org.apache.gora" name="gora-hbase"
rev="0.3" conf="*->default" />去掉注释。然后再重新编译一次。这样ivy会为你生成gora-hbase的插件
4、java.lang.NullPointerException
- java.lang.NullPointerException
- at org.apache.avro.util.Utf8.<init>(Utf8.java:37)
- at org.apache.nutch.crawl.GeneratorReducer.setup(GeneratorReducer.java:100)
- at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:174)
- at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
- at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:418)
- at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:398)
java.lang.NullPointerException
at org.apache.avro.util.Utf8.<init>(Utf8.java:37)
at org.apache.nutch.crawl.GeneratorReducer.setup(GeneratorReducer.java:100)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:174)
at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:418)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:398)
查看GeneratorReducer第100行代码如下:
batchId = newUtf8(conf.get(GeneratorJob.BATCH_ID));
可以看到是获取GeneratorJob.BATCH_ID。也就是generate.batch.id这个值的时候报空了!
解决方法:
修改GeneratorJob中的public Map<String,Object> run(Map<String,Object> args) 方法。
添加以下三行
- // generate batchId
- int randomSeed = Math.abs(new Random().nextInt());
- String batchId = (curTime / 1000) + "-" + randomSeed;
- getConf().set(BATCH_ID, batchId);
// generate batchId
int randomSeed = Math.abs(new Random().nextInt());
String batchId = (curTime / 1000) + "-" + randomSeed;
getConf().set(BATCH_ID, batchId);
【Apache Nutch系列】Nutch2.0配置安装异常集锦的更多相关文章
- Apache Maven 3.5.0配置安装
1.maven 3.5 下载地址:http://maven.apache.org/download.cgi 2.下载了解压到 3.配置环境变量 4.测试看是否安装成功 5.maven配置(全局配置,用 ...
- Apache Maven 3.6.1配置安装
Apache Maven 3.6.1配置安装 一.下载 maven下载地址:http://maven.apache.org/download.cgi 二.安装 1,解压即可用 2,环境变量配置 MAV ...
- Apache Maven 3.6.3配置安装
1.maven 3.5 下载地址:http://maven.apache.org/download.cgi 2.下载了解压到 3.配置环境变量 4.测试看是否安装成功 5.maven配置(全局配置,用 ...
- windows Server2012 之 IIS8.0配置安装完整教程
IIS8.0是windows Server2012自带的服务器管理系统,和以往不同,IIS8.0安装和操作都比较简单,界面很简洁,安装也很迅速.今天我们重点完整的演示下Internet Informa ...
- windows Server2012 IIS8.0配置安装完整教程
IIS8.0是windows Server2012自带的服务器管理系统,和以往不同,IIS8.0安装和操作都比较简单,界面很简洁,安装也很迅速.今天我们重点完整的演示下Internet Informa ...
- 【Apache KafKa系列之一】KafKa安装部署
kafka是一种高吞吐量的分布式发布订阅消息系统,她有如下特性: 通过O(1)的磁盘数据结构提供消息的持久化,这种结构对于即使数以TB的消息存储也能够保持长时间的稳定性能. 高吞吐量:即使是非常普通的 ...
- RedHat下apache\ftp\mysql 4.0 的安装方法
RedHat下安装这三个服务的方法大同小异 Apache服务: 找到Apache安装包: rpm -ivh httpd-2.0.40-21.i386.rpm 等待安装完成即可 检查安装结果: rpm ...
- 【转】Oozie4.2.0配置安装实战
什么是Oozie? Oozie是一种Java Web应用程序,它运行在Java servlet容器——即Tomcat——中,并使用数据库来存储以下内容: 工作流定义 当前运行的工作流实例,包括实例的状 ...
- Oozie4.2.0配置安装实战
软件版本号: Oozie4.2.0.Hadoop2.6.0,Spark1.4.1.Hive0.14.Pig0.15.0.Maven3.2.JDK1.7,zookeeper3.4.6.HBase1.1. ...
随机推荐
- php-5.6.26源代码 - opcode执行
文件 php-5.6.26/Zend/zend_vm_execute.h ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS ...
- php jsonp实例 mip无限滚动组件接口注意事项
在改造mip的过程中,很多同学遇到这样一个问题.mip无限滚动问题 异步请求数据接口(仅支持 JSONP 请求) 异步请求接口需要规范 callback 为 'callback' 那么什么是JSONP ...
- 微信小程序推广方案
拥有小程序只是基础,能玩转小程序运营才是关键.本文将会简单讲述十种最实用的小程序推广策略,结合具体案例阐述商家企业如何在拥有小程序后玩转小程序,快速实现小程序的推广. 一. 公众号+小程序 小程序可以 ...
- 学习python第十四天,模块
Python 模块(Module),是一个 Python 文件,以 .py 结尾,包含了 Python 对象定义和Python语句. 模块让你能够有逻辑地组织你的 Python 代码段. 把相关的代码 ...
- C语言函数篇(五)静态库和动态库的创建和使用
使用库函数是源码的一种保护??? <我猜的.> 库函数其实不是新鲜的东西,我们一直都在用,比如C库. 我们执行pringf() 这个函数的时候,就是调用C库的函数. 下面记录静态库和动态库 ...
- [CodeChef]RIN(最小割)
Description 有m门课可以在n个学期内学习,第i门课在第j个学期的收益是\(X_{i,j}\),一个学期可以学多门课,有的课之间有依赖关系,即必须先学a再学b,求最大收益.n,m<= ...
- TI C6000 数据存储处理与性能优化
存储器之于CPU好比仓库之于车间.车间加工过程中的原材料.半成品.成品等均需入出仓库,生产效率再快,如果仓库周转不善,也必然造成生产阻塞.如同仓库需要合理地规划管理一般,数据存储也需要恰当的处理技巧来 ...
- Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support (LEMP) On Ubuntu 12.04 LTS [repost]
from : http://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-lemp-on-ub ...
- VS Extension+NVelocity系列(一)——构建一个简单的NVelocity解析环境
一.前言 本节我们将实际实现一个简单的NVelocity解析环境,以便为以后的实例做一些基本工作,虽然NVelocity如何使用已经属于老掉牙的话题,但我只能专门挑出来一章来做铺垫.人生就是这样无奈啊 ...
- 随笔 —— 门徒 & 无限恐怖
门徒 忧思缠身,所为何物 不知何人,可免世俗 每每朝暮,心无释处 悲从中来,如泣如诉 仁者存世,满怀悲苦 逝者如斯,追还无路 上天无门,开怀捧腹 无路偏行,我行我素 无限恐怖 饥寒苦难谁知故,日日行路 ...