Mac OS Hadoop:线程“main”java.io.FileNotFoundException中的异常

时间:2015-11-26 03:24:29

标签: hadoop bigdata

当我在Hadoop中运行一个jar文件时,我遇到了一个问题。

在终端中,我得到以下异常:

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

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我遇到了这个问题,我的代码是用scala编写的,我想用hadoop运行jar命令: 像:

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

报告错误: 线程" main"中的例外情况java.io.FileNotFoundException:/ var / folders / dy / kgryx_f11g1fdqpcnc8jl m840000gp / T / hadoop-unjar5812913115154946721 / META-INF / LICENSE(是目录)

我在Hadoop java.io.IOException: Mkdirs failed to create /some/path上修改我的maven配置库 现在它已经过了。

我的maven shade插件配置如下:

        <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>

如果我添加true,它将报告未找到scala类,注释掉此配置工作。 祝你好运。