java.lang.ClassNotFoundException: org.apache.commons.configuration.Configuration

初始Hadoop开发过程中,遇到了一些坑,很多jar包没引用进来,报的错及解决方法


Exception in thread "main" java.util.ServiceConfigurationError: org.apache.hadoop.fs.FileSystem: Provider org.apache.hadoop.fs.viewfs.ViewFileSystem could not be instantiated
	at java.util.ServiceLoader.fail(Unknown Source)
	at java.util.ServiceLoader.access$100(Unknown Source)
	at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
	at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
	at java.util.ServiceLoader$1.next(Unknown Source)
	at org.apache.hadoop.fs.FileSystem.loadFileSystems(FileSystem.java:2364)
	at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2375)
	at org.apache.hadoop.fs.FsUrlStreamHandlerFactory.(FsUrlStreamHandlerFactory.java:62)
	at org.apache.hadoop.fs.FsUrlStreamHandlerFactory.(FsUrlStreamHandlerFactory.java:55)
	at hive.HiveJdbc.(HiveJdbc.java:21)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/configuration/Configuration
	at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.(DefaultMetricsSystem.java:38)
	at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.(DefaultMetricsSystem.java:36)
	at org.apache.hadoop.security.UserGroupInformation$UgiMetrics.create(UserGroupInformation.java:106)
	at org.apache.hadoop.security.UserGroupInformation.(UserGroupInformation.java:208)
	at org.apache.hadoop.fs.viewfs.ViewFileSystem.(ViewFileSystem.java:130)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at java.lang.Class.newInstance(Unknown Source)
	... 8 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.configuration.Configuration
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 18 more


缺少了commons-configuration-1.9.jar包,下载地址:conmons-configuration-1.9.jar

你可能感兴趣的:(hadoop)