1. On the Windows operating system, use the Eclipse development tool to download files from the HDFs Distributed file system to report null pointer exception resolution:
Log4j:warn No appenders could be found forLogger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory). Log4j:warn Please initialize the log4j system Properly.log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.ExceptioninchThread"Main"java.lang.NullPointerException at Java.lang.ProcessBuilder.start (Unknown Source) at Org.apache.hadoop.util.Shel L.runcommand (Shell.java:482) at Org.apache.hadoop.util.Shell.run (Shell.java:455) at Org.apache.hadoop.util.shell$shellcommandexecutor.execute (Shell.java:702) at Org.apache.hadoop.util.Shell.execCommand (Shell.java:791) at Org.apache.hadoop.util.Shell.execCommand (Shell.java:774) at Org.apache.hadoop.fs.RawLocalFileSystem.setPermission (Rawlocalfilesystem.java:646) at Org.apache.hadoop.fs.FilterFileSystem.setPermission (Filterfilesystem.java:472) at Org.apache.hadoop.fs.ChecksumFileSystem.create (Checksumfilesystem.java:460) at Org.apache.hadoop.fs.ChecksumFileSystem.create (Checksumfilesystem.java:426) at Org.apache.hadoop.fs.FileSystem.create (Filesystem.java:906) at Org.apache.hadoop.fs.FileSystem.create (Filesystem.java:887) at Org.apache.hadoop.fs.FileSystem.create (Filesystem.java:784) at Org.apache.hadoop.fs.FileUtil.copy (Fileutil.java:365) at Org.apache.hadoop.fs.FileUtil.copy (Fileutil.java:338) at Org.apache.hadoop.fs.FileUtil.copy (Fileutil.java:289) at Org.apache.hadoop.fs.FileSystem.copyToLocalFile (Filesystem.java:1968) at Org.apache.hadoop.fs.FileSystem.copyToLocalFile (Filesystem.java:1937) at Org.apache.hadoop.fs.FileSystem.copyToLocalFile (Filesystem.java:1913) at Com.bie.hadoop.crud.TextCreateNewFile.copyToLocalFile (Textcreatenewfile.java:191) at Com.bie.hadoop.crud.TextCreateNewFile.main (Textcreatenewfile.java:239)
2, the hadoop-2.5.0-cdh5.3.6.tar.gz file in the window operating system decompression, configuration environment variables.
Then verify that the configuration is successful, such as Window+r, enter CMD:
Then extract the file Hadoop-common-2.2.0-bin-32.rar as shown below and then copy it all to the hadoop-2.5.0-cdh5.3.6.tar.gz Bin directory:
Finally, restart your computer, run the download program, fix the problem, or configure the program as follows:
System.setproperty ("Hadoop.home.dir", "d:/biexiansheng/hadoop/hadoop-2.5.0-cdh5.3.6");
/** * Get the configuration information * @return*/ Public Staticconfiguration GetConfiguration () {Configuration conf=NewConfiguration (); Conf.Set("Fs.defaultfs","hdfs://192.168.19.131:9000"); //Restart the machine or set this value//system.setproperty ("Hadoop.home.dir", "d:/biexiansheng/hadoop/hadoop-2.5.0-cdh5.3.6"); returnconf;}
Exception in thread "main" java.lang.NullPointerException