在hadoop中运行jar文件时,遇到了一个问题。在终端中,我得到以下异常:
Exception in thread "main" java.io.FileNotFoundException: /var/folders/5_/hxmqt1090j1g1tqm485hr7tw0000gn/T/hadoop-unjar898783490589040837/META-INF/LICENSE (Is a directory)
我怎样才能解决这个问题?
jhkqcmku1#
我遇到了这个问题,我的代码是用scala编写的,我想用命令在hadoop上运行jar:like:
./bin/hadoop jar testing/learning-yarn-1.0.0.jar com.learning.yarn.simpleapp.SimpleApp
它报告错误:线程“main”java.io.filenotfoundexception中出现异常:/var/folders/dy/kgryx\u f11g1fdqpcc8jl m840000gp/t/hadoop-unjar5812913115154946721/meta-inf/license(是一个目录)我修改了基于hadoopjava.io.ioexception的maven配置:mkdirs未能创建/some/path,现在解决了它。我的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 class not found,注解掉这个配置。祝你好运。
1条答案
按热度按时间jhkqcmku1#
我遇到了这个问题,我的代码是用scala编写的,我想用命令在hadoop上运行jar:like:
它报告错误:线程“main”java.io.filenotfoundexception中出现异常:/var/folders/dy/kgryx\u f11g1fdqpcc8jl m840000gp/t/hadoop-unjar5812913115154946721/meta-inf/license(是一个目录)
我修改了基于hadoopjava.io.ioexception的maven配置:mkdirs未能创建/some/path,现在解决了它。
我的maven shade插件配置如下:
如果我添加true,它将报告scala class not found,注解掉这个配置。祝你好运。