2015-11-26 16 views
1

當我在Hadoop中運行jar文件時,遇到了問題。Mac OS Hadoop:線程「main」中的異常java.io.FileNotFoundException

在終端,我得到以下異常:

Exception in thread "main" java.io.FileNotFoundException: /var/folders/5_/hxmqt1090j1g1tqm485hr7tw0000gn/T/hadoop-unjar898783490589040837/META-INF/LICENSE (Is a directory) 

我怎樣才能解決這個問題?

+0

以下可能的重複http://stackoverflow.com/questions/10522835/hadoop-java-io-ioexception-mkdirs-failed-to-create-some-path – Ahmedov

回答

0

我就遇到了這個問題,寫我的代碼在Scala中,我想運行與命令在Hadoop的jar: 像:

./bin/hadoop jar testing/learning-yarn-1.0.0.jar com.learning.yarn.simpleapp.SimpleApp 

它報告錯誤: 異常線程「main」的Java。 io.FileNotFoundException:在/ var /文件夾/ DY/kgryx_f11g1fdqpcnc8jl m840000gp/T/Hadoop的unjar5812913115154946721/META-INF/LICENSE(是一個目錄)

我修改Hadoop java.io.IOException: Mkdirs failed to create /some/path 我的Maven配置基地,現在soved它。

我的maven燈罩的插件配置是這樣的:

 <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-shade-plugin</artifactId> 
      <version>2.4.3</version> 
      <executions> 
       <execution> 
        <phase>package</phase> 
        <goals> 
         <goal>shade</goal> 
        </goals> 
        <configuration> 
         <minimizeJar>true</minimizeJar> 
         <!-- <shadedArtifactAttached>true</shadedArtifactAttached>--> 
         <transformers> 
          <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"> 
          </transformer> 
         </transformers> 
         <filters> 
          <filter> 
           <artifact>*:*</artifact> 
           <excludes> 
            <exclude>log4j.properties</exclude> 
            <exclude>META-INF/*.SF</exclude> 
            <exclude>META-INF/*.DSA</exclude> 
            <exclude>META-INF/*.RSA</exclude> 
            <exclude>META-INF/LICENSE*</exclude> 
            <exclude>license/*</exclude> 
           </excludes> 
          </filter> 
          <filter> 
           <artifact>com.typesafe.akka</artifact> 
           <includes> 
            <include>reference.conf</include> 
           </includes> 
          </filter> 
         </filters> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 

如果我添加真它會報告沒有找到斯卡拉類,註釋掉此配置工作。 祝你好運。

相關問題