当前位置: 首页 > hadoop, 分布式系统 > 正文

windows7 hadoop 1.2.1 eclipse pulgin 生成(二)

关键字:
1 星2 星3 星4 星5 星 (2 次投票, 评分: 5.00, 总分: 5)
Loading ... Loading ...
baidu_share
文章目录

接着上一篇文章:windows7 hadoop 1.2.1 eclipse pulgin 生成.

一.org/apache/commons/configuration/Configuration不存在错误

点击”DFS Locations”中的”test”报以下错误:
dfs

An internal error occurred during: "Connecting to DFS test". org/apache/commons/configuration/Configuration

查看eclipse log日志:”Window”->”Show View”->”Other…”
eclipse-log
日志显示:

java.lang.NoClassDefFoundError: org/apache/commons/configuration/Configuration
	at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.<init>(DefaultMetricsSystem.java:37)
	at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.<clinit>(DefaultMetricsSystem.java:34)
	at org.apache.hadoop.security.UgiInstrumentation.create(UgiInstrumentation.java:51)
	at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:217)
	at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:185)
	at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:237)
	at org.apache.hadoop.security.KerberosName.<clinit>(KerberosName.java:79)
	at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:210)
	at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:185)
	at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:237)
	at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:522)
	at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:505)
	at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:1554)
	at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1455)
	at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:263)
	at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:124)
	at org.apache.hadoop.eclipse.server.HadoopServer.getDFS(HadoopServer.java:469)
	at org.apache.hadoop.eclipse.dfs.DFSPath.getDFS(DFSPath.java:146)
	at org.apache.hadoop.eclipse.dfs.DFSFolder.loadDFSFolderChildren(DFSFolder.java:61)
	at org.apache.hadoop.eclipse.dfs.DFSFolder$1.run(DFSFolder.java:178)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.configuration.Configuration
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 21 more

而查看META-INF/MANIFEST.MF包含的有commons-configuration-1.6.jar。lib目录下也有该文件。
在D:\hq\sdk\hadoop-1.2.1\build\contrib\eclipse-plugin\lib目录找到commons-configuration-1.6.jar,解压缩。把org文件夹拷贝到D:\hq\sdk\hadoop-1.2.1\build\contrib\eclipse-plugin\classes目录下。

利用ant进行编译。在MapReduceTools项目下,找到build.xml,右键点击,选择”Run as” ->”Ant Build”.在编译成功后,D:\hq\sdk\hadoop-1.2.1\build\contrib\eclipse-plugin\hadoop-eclipse-plugin-1.2.1.jar.把hadoop-eclipse-plugin-1.2.1.jar拷贝到eclipse\plugins目录下。重启eclipse。

二.org/apache/commons/lang/StringUtils不存在错误

点击”DFS Locations”中的”test”报以下错误:

An internal error occurred during: "Connecting to DFS test".org/apache/commons/lang/StringUtils

eclipse log报错如下:

java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
	at org.apache.hadoop.metrics2.lib.MetricMutableStat.<init>(MetricMutableStat.java:59)
	at org.apache.hadoop.metrics2.impl.MetricsSystemImpl.<init>(MetricsSystemImpl.java:75)
	at org.apache.hadoop.metrics2.impl.MetricsSystemImpl.<init>(MetricsSystemImpl.java:120)
	at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.<init>(DefaultMetricsSystem.java:37)
	at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.<clinit>(DefaultMetricsSystem.java:34)
	at org.apache.hadoop.security.UgiInstrumentation.create(UgiInstrumentation.java:51)
	at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:217)
	at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:185)
	at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:237)
	at org.apache.hadoop.security.KerberosName.<clinit>(KerberosName.java:79)
	at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:210)
	at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:185)
	at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:237)
	at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:522)
	at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:505)
	at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:1554)
	at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1455)
	at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:263)
	at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:124)
	at org.apache.hadoop.eclipse.server.HadoopServer.getDFS(HadoopServer.java:469)
	at org.apache.hadoop.eclipse.dfs.DFSPath.getDFS(DFSPath.java:146)
	at org.apache.hadoop.eclipse.dfs.DFSFolder.loadDFSFolderChildren(DFSFolder.java:61)
	at org.apache.hadoop.eclipse.dfs.DFSFolder$1.run(DFSFolder.java:178)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 24 more

在D:\hq\sdk\hadoop-1.2.1\build\contrib\eclipse-plugin\lib目录找到commons-lang-2.4.jar,解压缩。把org文件夹拷贝到D:\hq\sdk\hadoop-1.2.1\build\contrib\eclipse-plugin\classes目录下。

利用ant进行编译。在MapReduceTools项目下,找到build.xml,右键点击,选择”Run as” ->”Ant Build”.在编译成功后,D:\hq\sdk\hadoop-1.2.1\build\contrib\eclipse-plugin\hadoop-eclipse-plugin-1.2.1.jar.把hadoop-eclipse-plugin-1.2.1.jar拷贝到eclipse\plugins目录下。重启eclipse。

备注:META-INF/MANIFEST.MF中的Bundle-ClassPath没写好也可能出现各种问题。我的例子:

Bundle-ClassPath: classes/,
 lib/hadoop-core.jar,
 lib/commons-cli-1.2.jar,
 lib/commons-httpclient-3.0.1.jar,
 lib/jackson-core-asl-1.8.8.jar,
 lib/jackson-mapper-asl-1.8.8.jar,
 lib/commons-configuration-1.6.jar,
 lib/commons-lang-2.4.jar

至此点击”DFS Locations”中的”test”连接正常(hadoop要在cygwin下启动起来)。
dfs-list

“DFS Locations”中hadoop配置图:
hadoop-location

本文固定链接: http://www.chepoo.com/windows7-hadoop-1-2-1-eclipse-pulgin-compiler-2.html | IT技术精华网

windows7 hadoop 1.2.1 eclipse pulgin 生成(二):等您坐沙发呢!

发表评论