Error resolution for eclipse connection Hadoop 1.2.1 in Windows 7 environment

Source: Internet
Author: User
Tags copy

When you connect the hadoop1.2.1 cluster through eclipse in a Win7 environment, you will experience the following error:

Exception in thread ' main ' java.io.IOException:Failed to set permissions of path: \tmp\hadoop-administrator\mapred\stagi Ng\administrator-519341271\.staging to 0700

At this point only need to modify the Org.apache.hadoop.fs.FileUtil file and recompile, the simple solution is as follows: 1.eclipse new Java Project 2. All Hadoop-related jar packs are imported into Project 3. To the source code copy src/core/ Org/apache/hadoop/fs/fileutil.java file, pasted into the SRC directory of Eclipse Engineering 4. Find the following sections to comment out the code in the Checkreturnvalue method

  private static void Checkreturnvalue (Boolean rv, File p,   
                                       fspermission permission  
                                       ) throws IOException {  
    /*< C4/>//win7 connect to Linux Hadoop  
if (!RV) {  
      throw new IOException ("Failed to set permissions of path:" + P +
   "to" +   
                            String.Format ("%04o", Permission.toshort ());  
    }  
*/
  }

5. To the project output directory to find the class file, there will be two class files, because Fileutil.java has an internal class

6. Add the class file to the corresponding directory in Hadoop-core-1.2.1.jar, overwriting the original file

7. Copy the updated Hadoop-core-1.2.1.jar to the Hadoop cluster, overwrite the original file, restart the Hadoop cluster

8. Add updated Hadoop-core-1.2.1.jar to project dependencies, if Maven may involve overwriting corresponding files in the MAVEN library

9. Run the program, everything is!!!

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/tools/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.