gpt4 book ai didi

java - Apache nutch 错误 NoClassDefFoundError "com/google/protobuf/Message"

转载 作者:可可西里 更新时间:2023-11-01 14:52:53 27 4
gpt4 key购买 nike

我将 apache nutch 2.3 与 hadoop 1.2.1 和 hbase 0.94 一起使用。我已经为分布式模式配置了 apache nutch。当我运行爬行时,出现以下错误

15/12/21 12:06:56 INFO zookeeper.ClientCnxn: Session establishment complete on server node1/1.11.1.2:2181, sessionid = 0x151ba038ac60250, negotiated timeout = 180000
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/protobuf/Message
at org.apache.hadoop.hbase.io.HbaseObjectWritable.<clinit>(HbaseObjectWritable.java:265)
at org.apache.hadoop.hbase.ipc.Invocation.write(Invocation.java:139)
at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.sendParam(HBaseClient.java:620)
at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:989)
at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:87)
at com.sun.proxy.$Proxy5.getProtocolVersion(Unknown Source)
at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:141)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:813)
at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:127)
at org.apache.gora.hbase.store.HBaseStore.initialize(HBaseStore.java:115)
at org.apache.gora.store.DataStoreFactory.initializeDataStore(DataStoreFactory.java:104)
at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:163)
at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:137)
at org.apache.nutch.storage.StorageUtils.createWebStore(StorageUtils.java:78)
at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:218)
at org.apache.nutch.crawl.InjectorJob.inject(InjectorJob.java:252)
at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:275)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.nutch.crawl.InjectorJob.main(InjectorJob.java:284)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
Caused by: java.lang.ClassNotFoundException: com.google.protobuf.Message
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 24 more

在nutch的lib中,有一个protobuf-java-2.4.1.jar的jar如何解决?

最佳答案

我认为您应该将 protobuf-java{version}.jar 添加到 hadoop lib 目录。它应该可以解决您的问题。用于类路径验证。运行以下命令

hadoop classpath |grep protobuf

如果它包含相应的 jar 则表示它已被添加到类路径中。

关于java - Apache nutch 错误 NoClassDefFoundError "com/google/protobuf/Message",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34390548/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com