mac上IDEA编辑spark提交遇到的问题

1.问题1:mac上使用IDEA打包好scala编写的spark项目后,把jar包放到集群上使用spark-submit提交时,报错说主类找不到,解决如下:

(2)在pom文件中添加如下:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>2.3</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <version>3.2.2</version>
            <executions>
                <execution>
                    <id>eclipse-add-source</id>
                    <goals>
                        <goal>add-source</goal>
                    </goals>
                </execution>
                <execution>
                    <id>scala-compile-first</id>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
                <execution>
                    <id>scala-test-compile-first</id>
                    <phase>process-test-resources</phase>
                    <goals>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
                <execution>
                    <id>attach-scaladocs</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>doc-jar</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <scalaVersion>2.10.4</scalaVersion>
                <recompileMode>incremental</recompileMode>
                <useZincServer>true</useZincServer>
                <args>
                    <arg>-unchecked</arg>
                    <arg>-deprecation</arg>
                    <arg>-feature</arg>
                </args>
                <!--<jvmArgs>-->
                <!--<jvmArg>-Xms1024m</jvmArg>-->
                <!--<jvmArg>-Xmx1024m</jvmArg>-->
                <!--<jvmArg>-XX:PermSize=${PermGen}</jvmArg>-->
                <!--<jvmArg>-XX:MaxPermSize=${MaxPermGen}</jvmArg>-->
                <!--<jvmArg>-XX:ReservedCodeCacheSize=${CodeCacheSize}</jvmArg>-->
                <!--</jvmArgs>-->
                <javacArgs>
                    <javacArg>-source</javacArg>
                    <javacArg>${java.version}</javacArg>
                    <javacArg>-target</javacArg>
                    <javacArg>${java.version}</javacArg>
                    <javacArg>-Xlint:all,-serial,-path</javacArg>
                </javacArgs>
            </configuration>
        </plugin>
    </plugins>
</build>

(2)使用maven重新编译,打包,步骤,如下图:

2.问题2:使用spark-submit提交时,问题1顺利解决,新错误是:Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes,解决如下:

zip -d 你的jar文件 META-INF/*.RSA META-INF/*.DSA META-INF/*.SF

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值