一、报错
在进行SparkSql代码调试时,不同的项目相同的pom.xml依赖相同的代码,其中一个项目正常执行,另一个项目报错如下:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.security.HadoopKerberosName.setRuleMechanism(Ljava/lang/String;)V
"C:\Program Files\Java\jdk1.8.0_161\bin\java.exe" "-javaagent:D:\01 Software Related\02 Installation\02 Work\JetBrains\IntelliJ IDEA 2020.1.4\lib\idea_rt.jar=55950:D:\01 Software Related\02 Installation\02 Work\JetBrains\IntelliJ IDEA 2020.1.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_161\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\rt.jar;D:\03 Knowledge Related\02 Learning\02 Bigdata\00 kkb\02 Projects\IDEA_WORKSPACE\bigdata_hadoop\Spark_sql\target\classes;D:\softwares_install\maven_repository\org\scala-lang\scala-library\2.11.8\scala-library-2.11.8.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-core_2.11\2.3.3\spark-core_2.11-2.3.3.jar;D:\softwares_install\maven_repository\org\apache\avro\avro\1.7.7\avro-1.7.7.jar;D:\softwares_install\maven_repository\org\codehaus\jackson\jackson-core-asl\1.9.13\jackson-core-asl-1.9.13.jar;D:\softwares_install\maven_repository\com\thoughtworks\paranamer\paranamer\2.3\paranamer-2.3.jar;D:\softwares_install\maven_repository\org\apache\avro\avro-mapred\1.7.7\avro-mapred-1.7.7-hadoop2.jar;D:\softwares_install\maven_repository\org\apache\avro\avro-ipc\1.7.7\avro-ipc-1.7.7.jar;D:\softwares_install\maven_repository\org\apache\avro\avro-ipc\1.7.7\avro-ipc-1.7.7-tests.jar;D:\softwares_install\maven_repository\com\twitter\chill_2.11\0.8.4\chill_2.11-0.8.4.jar;D:\softwares_install\maven_repository\com\esotericsoftware\kryo-shaded\3.0.3\kryo-shaded-3.0.3.jar;D:\softwares_install\maven_repository\com\esotericsoftware\minlog\1.3.0\minlog-1.3.0.jar;D:\softwares_install\maven_repository\org\objenesis\objenesis\2.1\objenesis-2.1.jar;D:\softwares_install\maven_repository\com\twitter\chill-java\0.8.4\chill-java-0.8.4.jar;D:\softwares_install\maven_repository\org\apache\xbean\xbean-asm5-shaded\4.4\xbean-asm5-shaded-4.4.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-launcher_2.11\2.3.3\spark-launcher_2.11-2.3.3.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-kvstore_2.11\2.3.3\spark-kvstore_2.11-2.3.3.jar;D:\softwares_install\maven_repository\com\fasterxml\jackson\core\jackson-core\2.6.7\jackson-core-2.6.7.jar;D:\softwares_install\maven_repository\com\fasterxml\jackson\core\jackson-annotations\2.6.7\jackson-annotations-2.6.7.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-network-common_2.11\2.3.3\spark-network-common_2.11-2.3.3.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-network-shuffle_2.11\2.3.3\spark-network-shuffle_2.11-2.3.3.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-unsafe_2.11\2.3.3\spark-unsafe_2.11-2.3.3.jar;D:\softwares_install\maven_repository\net\java\dev\jets3t\jets3t\0.9.4\jets3t-0.9.4.jar;D:\softwares_install\maven_repository\org\apache\httpcomponents\httpcore\4.4.1\httpcore-4.4.1.jar;D:\softwares_install\maven_repository\javax\activation\activation\1.1.1\activation-1.1.1.jar;D:\softwares_install\maven_repository\org\bouncycastle\bcprov-jdk15on\1.52\bcprov-jdk15on-1.52.jar;D:\softwares_install\maven_repository\com\jamesmurty\utils\java-xmlbuilder\1.1\java-xmlbuilder-1.1.jar;D:\softwares_install\maven_repository\net\iharder\base64\2.3.8\base64-2.3.8.jar;D:\softwares_install\maven_repository\org\apache\curator\curator-recipes\2.6.0\curator-recipes-2.6.0.jar;D:\softwares_install\maven_repository\org\apache\curator\curator-framework\2.6.0\curator-framework-2.6.0.jar;D:\softwares_install\maven_repository\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar;D:\softwares_install\maven_repository\org\apache\commons\commons-math3\3.4.1\commons-math3-3.4.1.jar;D:\softwares_install\maven_repository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;D:\softwares_install\maven_repository\org\slf4j\slf4j-api\1.7.16\slf4j-api-1.7.16.jar;D:\softwares_install\maven_repository\org\slf4j\jul-to-slf4j\1.7.16\jul-to-slf4j-1.7.16.jar;D:\softwares_install\maven_repository\org\slf4j\jcl-over-slf4j\1.7.16\jcl-over-slf4j-1.7.16.jar;D:\softwares_install\maven_repository\org\slf4j\slf4j-log4j12\1.7.16\slf4j-log4j12-1.7.16.jar;D:\softwares_install\maven_repository\com\ning\compress-lzf\1.0.3\compress-lzf-1.0.3.jar;D:\softwares_install\maven_repository\org\xerial\snappy\snappy-java\1.1.2.6\snappy-java-1.1.2.6.jar;D:\softwares_install\maven_repository\org\lz4\lz4-java\1.4.0\lz4-java-1.4.0.jar;D:\softwares_install\maven_repository\com\github\luben\zstd-jni\1.3.2-2\zstd-jni-1.3.2-2.jar;D:\softwares_install\maven_repository\org\roaringbitmap\RoaringBitmap\0.5.11\RoaringBitmap-0.5.11.jar;D:\softwares_install\maven_repository\commons-net\commons-net\2.2\commons-net-2.2.jar;D:\softwares_install\maven_repository\org\json4s\json4s-jackson_2.11\3.2.11\json4s-jackson_2.11-3.2.11.jar;D:\softwares_install\maven_repository\org\json4s\json4s-core_2.11\3.2.11\json4s-core_2.11-3.2.11.jar;D:\softwares_install\maven_repository\org\json4s\json4s-ast_2.11\3.2.11\json4s-ast_2.11-3.2.11.jar;D:\softwares_install\maven_repository\org\scala-lang\scalap\2.11.0\scalap-2.11.0.jar;D:\softwares_install\maven_repository\org\scala-lang\scala-compiler\2.11.0\scala-compiler-2.11.0.jar;D:\softwares_install\maven_repository\org\scala-lang\modules\scala-xml_2.11\1.0.1\scala-xml_2.11-1.0.1.jar;D:\softwares_install\maven_repository\org\glassfish\jersey\core\jersey-client\2.22.2\jersey-client-2.22.2.jar;D:\softwares_install\maven_repository\javax\ws\rs\javax.ws.rs-api\2.0.1\javax.ws.rs-api-2.0.1.jar;D:\softwares_install\maven_repository\org\glassfish\hk2\hk2-api\2.4.0-b34\hk2-api-2.4.0-b34.jar;D:\softwares_install\maven_repository\org\glassfish\hk2\hk2-utils\2.4.0-b34\hk2-utils-2.4.0-b34.jar;D:\softwares_install\maven_repository\org\glassfish\hk2\external\aopalliance-repackaged\2.4.0-b34\aopalliance-repackaged-2.4.0-b34.jar;D:\softwares_install\maven_repository\org\glassfish\hk2\external\javax.inject\2.4.0-b34\javax.inject-2.4.0-b34.jar;D:\softwares_install\maven_repository\org\glassfish\hk2\hk2-locator\2.4.0-b34\hk2-locator-2.4.0-b34.jar;D:\softwares_install\maven_repository\org\javassist\javassist\3.18.1-GA\javassist-3.18.1-GA.jar;D:\softwares_install\maven_repository\org\glassfish\jersey\core\jersey-common\2.22.2\jersey-common-2.22.2.jar;D:\softwares_install\maven_repository\javax\annotation\javax.annotation-api\1.2\javax.annotation-api-1.2.jar;D:\softwares_install\maven_repository\org\glassfish\jersey\bundles\repackaged\jersey-guava\2.22.2\jersey-guava-2.22.2.jar;D:\softwares_install\maven_repository\org\glassfish\hk2\osgi-resource-locator\1.0.1\osgi-resource-locator-1.0.1.jar;D:\softwares_install\maven_repository\org\glassfish\jersey\core\jersey-server\2.22.2\jersey-server-2.22.2.jar;D:\softwares_install\maven_repository\org\glassfish\jersey\media\jersey-media-jaxb\2.22.2\jersey-media-jaxb-2.22.2.jar;D:\softwares_install\maven_repository\javax\validation\validation-api\1.1.0.Final\validation-api-1.1.0.Final.jar;D:\softwares_install\maven_repository\org\glassfish\jersey\containers\jersey-container-servlet\2.22.2\jersey-container-servlet-2.22.2.jar;D:\softwares_install\maven_repository\org\glassfish\jersey\containers\jersey-container-servlet-core\2.22.2\jersey-container-servlet-core-2.22.2.jar;D:\softwares_install\maven_repository\io\netty\netty-all\4.1.17.Final\netty-all-4.1.17.Final.jar;D:\softwares_install\maven_repository\io\netty\netty\3.9.9.Final\netty-3.9.9.Final.jar;D:\softwares_install\maven_repository\com\clearspring\analytics\stream\2.7.0\stream-2.7.0.jar;D:\softwares_install\maven_repository\io\dropwizard\metrics\metrics-core\3.1.5\metrics-core-3.1.5.jar;D:\softwares_install\maven_repository\io\dropwizard\metrics\metrics-jvm\3.1.5\metrics-jvm-3.1.5.jar;D:\softwares_install\maven_repository\io\dropwizard\metrics\metrics-json\3.1.5\metrics-json-3.1.5.jar;D:\softwares_install\maven_repository\io\dropwizard\metrics\metrics-graphite\3.1.5\metrics-graphite-3.1.5.jar;D:\softwares_install\maven_repository\com\fasterxml\jackson\core\jackson-databind\2.6.7.1\jackson-databind-2.6.7.1.jar;D:\softwares_install\maven_repository\com\fasterxml\jackson\module\jackson-module-scala_2.11\2.6.7.1\jackson-module-scala_2.11-2.6.7.1.jar;D:\softwares_install\maven_repository\org\scala-lang\scala-reflect\2.11.8\scala-reflect-2.11.8.jar;D:\softwares_install\maven_repository\com\fasterxml\jackson\module\jackson-module-paranamer\2.7.9\jackson-module-paranamer-2.7.9.jar;D:\softwares_install\maven_repository\org\apache\ivy\ivy\2.4.0\ivy-2.4.0.jar;D:\softwares_install\maven_repository\oro\oro\2.0.8\oro-2.0.8.jar;D:\softwares_install\maven_repository\net\razorvine\pyrolite\4.13\pyrolite-4.13.jar;D:\softwares_install\maven_repository\net\sf\py4j\py4j\0.10.7\py4j-0.10.7.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-tags_2.11\2.3.3\spark-tags_2.11-2.3.3.jar;D:\softwares_install\maven_repository\org\apache\commons\commons-crypto\1.0.0\commons-crypto-1.0.0.jar;D:\softwares_install\maven_repository\org\spark-project\spark\unused\1.0.0\unused-1.0.0.jar;D:\softwares_install\maven_repository\mysql\mysql-connector-java\5.1.38\mysql-connector-java-5.1.38.jar;D:\softwares_install\maven_repository\org\apache\commons\commons-lang3\3.7\commons-lang3-3.7.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-spark\2.1.0-cdh6.2.0\hbase-spark-2.1.0-cdh6.2.0.jar;D:\softwares_install\maven_repository\org\apache\hbase\thirdparty\hbase-shaded-miscellaneous\2.1.0\hbase-shaded-miscellaneous-2.1.0.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-protocol\2.1.0-cdh6.2.0\hbase-protocol-2.1.0-cdh6.2.0.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-protocol-shaded\2.1.0-cdh6.2.0\hbase-protocol-shaded-2.1.0-cdh6.2.0.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-annotations\2.1.0-cdh6.2.0\hbase-annotations-2.1.0-cdh6.2.0.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-zookeeper\2.1.0-cdh6.2.0\hbase-zookeeper-2.1.0-cdh6.2.0.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-mapreduce\2.1.0-cdh6.2.0\hbase-mapreduce-2.1.0-cdh6.2.0.jar;D:\softwares_install\maven_repository\com\google\protobuf\protobuf-java\2.5.0\protobuf-java-2.5.0.jar;D:\softwares_install\maven_repository\commons-io\commons-io\2.5\commons-io-2.5.jar;D:\softwares_install\maven_repository\org\apache\yetus\audience-annotations\0.5.0\audience-annotations-0.5.0.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-server\2.2.2\hbase-server-2.2.2.jar;D:\softwares_install\maven_repository\org\apache\hbase\thirdparty\hbase-shaded-protobuf\2.2.1\hbase-shaded-protobuf-2.2.1.jar;D:\softwares_install\maven_repository\org\apache\hbase\thirdparty\hbase-shaded-netty\2.2.1\hbase-shaded-netty-2.2.1.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-http\2.2.2\hbase-http-2.2.2.jar;D:\softwares_install\maven_repository\org\eclipse\jetty\jetty-http\9.3.27.v20190418\jetty-http-9.3.27.v20190418.jar;D:\softwares_install\maven_repository\org\eclipse\jetty\jetty-security\9.3.27.v20190418\jetty-security-9.3.27.v20190418.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-procedure\2.2.2\hbase-procedure-2.2.2.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-replication\2.2.2\hbase-replication-2.2.2.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-metrics-api\2.2.2\hbase-metrics-api-2.2.2.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-metrics\2.2.2\hbase-metrics-2.2.2.jar;D:\softwares_install\maven_repository\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-hadoop-compat\2.2.2\hbase-hadoop-compat-2.2.2.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-hadoop2-compat\2.2.2\hbase-hadoop2-compat-2.2.2.jar;D:\softwares_install\maven_repository\org\eclipse\jetty\jetty-server\9.3.27.v20190418\jetty-server-9.3.27.v20190418.jar;D:\softwares_install\maven_repository\org\eclipse\jetty\jetty-io\9.3.27.v20190418\jetty-io-9.3.27.v20190418.jar;D:\softwares_install\maven_repository\org\eclipse\jetty\jetty-servlet\9.3.27.v20190418\jetty-servlet-9.3.27.v20190418.jar;D:\softwares_install\maven_repository\org\eclipse\jetty\jetty-webapp\9.3.27.v20190418\jetty-webapp-9.3.27.v20190418.jar;D:\softwares_install\maven_repository\org\eclipse\jetty\jetty-xml\9.3.27.v20190418\jetty-xml-9.3.27.v20190418.jar;D:\softwares_install\maven_repository\org\glassfish\web\javax.servlet.jsp\2.3.2\javax.servlet.jsp-2.3.2.jar;D:\softwares_install\maven_repository\org\glassfish\javax.el\3.0.1-b12\javax.el-3.0.1-b12.jar;D:\softwares_install\maven_repository\javax\servlet\jsp\javax.servlet.jsp-api\2.3.1\javax.servlet.jsp-api-2.3.1.jar;D:\softwares_install\maven_repository\org\apache\zookeeper\zookeeper\3.4.10\zookeeper-3.4.10.jar;D:\softwares_install\maven_repository\org\jamon\jamon-runtime\2.4.1\jamon-runtime-2.4.1.jar;D:\softwares_install\maven_repository\org\apache\htrace\htrace-core4\4.2.0-incubating\htrace-core4-4.2.0-incubating.jar;D:\softwares_install\maven_repository\com\lmax\disruptor\3.3.6\disruptor-3.3.6.jar;D:\softwares_install\maven_repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-distcp\2.8.5\hadoop-distcp-2.8.5.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-auth\2.8.5\hadoop-auth-2.8.5.jar;D:\softwares_install\maven_repository\com\nimbusds\nimbus-jose-jwt\4.41.1\nimbus-jose-jwt-4.41.1.jar;D:\softwares_install\maven_repository\com\github\stephenc\jcip\jcip-annotations\1.0-1\jcip-annotations-1.0-1.jar;D:\softwares_install\maven_repository\org\apache\directory\server\apacheds-kerberos-codec\2.0.0-M15\apacheds-kerberos-codec-2.0.0-M15.jar;D:\softwares_install\maven_repository\org\apache\directory\server\apacheds-i18n\2.0.0-M15\apacheds-i18n-2.0.0-M15.jar;D:\softwares_install\maven_repository\org\apache\directory\api\api-asn1-api\1.0.0-M20\api-asn1-api-1.0.0-M20.jar;D:\softwares_install\maven_repository\org\apache\directory\api\api-util\1.0.0-M20\api-util-1.0.0-M20.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-annotations\2.8.5\hadoop-annotations-2.8.5.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-common\2.2.2\hbase-common-2.2.2.jar;D:\softwares_install\maven_repository\com\github\stephenc\findbugs\findbugs-annotations\1.3.9-1\findbugs-annotations-1.3.9-1.jar;D:\softwares_install\maven_repository\org\apache\hbase\hbase-client\2.2.2\hbase-client-2.2.2.jar;D:\softwares_install\maven_repository\org\jruby\jcodings\jcodings\1.0.18\jcodings-1.0.18.jar;D:\softwares_install\maven_repository\org\jruby\joni\joni\2.1.11\joni-2.1.11.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-streaming_2.11\2.3.3\spark-streaming_2.11-2.3.3.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-hive_2.11\2.3.3\spark-hive_2.11-2.3.3.jar;D:\softwares_install\maven_repository\com\twitter\parquet-hadoop-bundle\1.6.0\parquet-hadoop-bundle-1.6.0.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-sql_2.11\2.3.3\spark-sql_2.11-2.3.3.jar;D:\softwares_install\maven_repository\com\univocity\univocity-parsers\2.5.9\univocity-parsers-2.5.9.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-sketch_2.11\2.3.3\spark-sketch_2.11-2.3.3.jar;D:\softwares_install\maven_repository\org\apache\spark\spark-catalyst_2.11\2.3.3\spark-catalyst_2.11-2.3.3.jar;D:\softwares_install\maven_repository\org\scala-lang\modules\scala-parser-combinators_2.11\1.0.4\scala-parser-combinators_2.11-1.0.4.jar;D:\softwares_install\maven_repository\org\codehaus\janino\janino\3.0.8\janino-3.0.8.jar;D:\softwares_install\maven_repository\org\codehaus\janino\commons-compiler\3.0.8\commons-compiler-3.0.8.jar;D:\softwares_install\maven_repository\org\antlr\antlr4-runtime\4.7\antlr4-runtime-4.7.jar;D:\softwares_install\maven_repository\org\apache\orc\orc-core\1.4.4\orc-core-1.4.4-nohive.jar;D:\softwares_install\maven_repository\io\airlift\aircompressor\0.8\aircompressor-0.8.jar;D:\softwares_install\maven_repository\org\apache\orc\orc-mapreduce\1.4.4\orc-mapreduce-1.4.4-nohive.jar;D:\softwares_install\maven_repository\org\apache\parquet\parquet-column\1.8.3\parquet-column-1.8.3.jar;D:\softwares_install\maven_repository\org\apache\parquet\parquet-common\1.8.3\parquet-common-1.8.3.jar;D:\softwares_install\maven_repository\org\apache\parquet\parquet-encoding\1.8.3\parquet-encoding-1.8.3.jar;D:\softwares_install\maven_repository\org\apache\parquet\parquet-hadoop\1.8.3\parquet-hadoop-1.8.3.jar;D:\softwares_install\maven_repository\org\apache\parquet\parquet-format\2.3.1\parquet-format-2.3.1.jar;D:\softwares_install\maven_repository\org\apache\parquet\parquet-jackson\1.8.3\parquet-jackson-1.8.3.jar;D:\softwares_install\maven_repository\org\apache\arrow\arrow-vector\0.8.0\arrow-vector-0.8.0.jar;D:\softwares_install\maven_repository\org\apache\arrow\arrow-format\0.8.0\arrow-format-0.8.0.jar;D:\softwares_install\maven_repository\org\apache\arrow\arrow-memory\0.8.0\arrow-memory-0.8.0.jar;D:\softwares_install\maven_repository\com\carrotsearch\hppc\0.7.2\hppc-0.7.2.jar;D:\softwares_install\maven_repository\com\vlkan\flatbuffers\1.2.0-3f79e055\flatbuffers-1.2.0-3f79e055.jar;D:\softwares_install\maven_repository\org\spark-project\hive\hive-exec\1.2.1.spark2\hive-exec-1.2.1.spark2.jar;D:\softwares_install\maven_repository\javolution\javolution\5.5.1\javolution-5.5.1.jar;D:\softwares_install\maven_repository\log4j\apache-log4j-extras\1.2.17\apache-log4j-extras-1.2.17.jar;D:\softwares_install\maven_repository\org\antlr\antlr-runtime\3.4\antlr-runtime-3.4.jar;D:\softwares_install\maven_repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar;D:\softwares_install\maven_repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;D:\softwares_install\maven_repository\org\antlr\ST4\4.0.4\ST4-4.0.4.jar;D:\softwares_install\maven_repository\com\googlecode\javaewah\JavaEWAH\0.3.2\JavaEWAH-0.3.2.jar;D:\softwares_install\maven_repository\org\iq80\snappy\snappy\0.2\snappy-0.2.jar;D:\softwares_install\maven_repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;D:\softwares_install\maven_repository\net\sf\opencsv\opencsv\2.3\opencsv-2.3.jar;D:\softwares_install\maven_repository\org\spark-project\hive\hive-metastore\1.2.1.spark2\hive-metastore-1.2.1.spark2.jar;D:\softwares_install\maven_repository\com\jolbox\bonecp\0.8.0.RELEASE\bonecp-0.8.0.RELEASE.jar;D:\softwares_install\maven_repository\org\datanucleus\datanucleus-api-jdo\3.2.6\datanucleus-api-jdo-3.2.6.jar;D:\softwares_install\maven_repository\org\datanucleus\datanucleus-rdbms\3.2.9\datanucleus-rdbms-3.2.9.jar;D:\softwares_install\maven_repository\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar;D:\softwares_install\maven_repository\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar;D:\softwares_install\maven_repository\javax\jdo\jdo-api\3.0.1\jdo-api-3.0.1.jar;D:\softwares_install\maven_repository\javax\transaction\jta\1.1\jta-1.1.jar;D:\softwares_install\maven_repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;D:\softwares_install\maven_repository\org\apache\calcite\calcite-avatica\1.2.0-incubating\calcite-avatica-1.2.0-incubating.jar;D:\softwares_install\maven_repository\org\apache\calcite\calcite-core\1.2.0-incubating\calcite-core-1.2.0-incubating.jar;D:\softwares_install\maven_repository\org\apache\calcite\calcite-linq4j\1.2.0-incubating\calcite-linq4j-1.2.0-incubating.jar;D:\softwares_install\maven_repository\net\hydromatic\eigenbase-properties\1.1.5\eigenbase-properties-1.1.5.jar;D:\softwares_install\maven_repository\org\apache\httpcomponents\httpclient\4.5.4\httpclient-4.5.4.jar;D:\softwares_install\maven_repository\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar;D:\softwares_install\maven_repository\joda-time\joda-time\2.9.3\joda-time-2.9.3.jar;D:\softwares_install\maven_repository\org\jodd\jodd-core\3.5.2\jodd-core-3.5.2.jar;D:\softwares_install\maven_repository\org\datanucleus\datanucleus-core\3.2.10\datanucleus-core-3.2.10.jar;D:\softwares_install\maven_repository\org\apache\thrift\libthrift\0.9.3\libthrift-0.9.3.jar;D:\softwares_install\maven_repository\org\apache\thrift\libfb303\0.9.3\libfb303-0.9.3.jar;D:\softwares_install\maven_repository\org\apache\derby\derby\10.12.1.1\derby-10.12.1.1.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-client\3.1.4\hadoop-client-3.1.4.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-hdfs-client\3.1.4\hadoop-hdfs-client-3.1.4.jar;D:\softwares_install\maven_repository\com\squareup\okhttp\okhttp\2.7.5\okhttp-2.7.5.jar;D:\softwares_install\maven_repository\com\squareup\okio\okio\1.6.0\okio-1.6.0.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-yarn-api\3.1.4\hadoop-yarn-api-3.1.4.jar;D:\softwares_install\maven_repository\javax\xml\bind\jaxb-api\2.2.11\jaxb-api-2.2.11.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-yarn-client\3.1.4\hadoop-yarn-client-3.1.4.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-mapreduce-client-jobclient\3.1.4\hadoop-mapreduce-client-jobclient-3.1.4.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-mapreduce-client-common\3.1.4\hadoop-mapreduce-client-common-3.1.4.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-common\3.1.4\hadoop-common-3.1.4.jar;D:\softwares_install\maven_repository\com\google\guava\guava\27.0-jre\guava-27.0-jre.jar;D:\softwares_install\maven_repository\com\google\guava\failureaccess\1.0\failureaccess-1.0.jar;D:\softwares_install\maven_repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;D:\softwares_install\maven_repository\org\checkerframework\checker-qual\2.5.2\checker-qual-2.5.2.jar;D:\softwares_install\maven_repository\com\google\errorprone\error_prone_annotations\2.2.0\error_prone_annotations-2.2.0.jar;D:\softwares_install\maven_repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;D:\softwares_install\maven_repository\org\codehaus\mojo\animal-sniffer-annotations\1.17\animal-sniffer-annotations-1.17.jar;D:\softwares_install\maven_repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;D:\softwares_install\maven_repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\softwares_install\maven_repository\org\eclipse\jetty\jetty-util\9.4.20.v20190813\jetty-util-9.4.20.v20190813.jar;D:\softwares_install\maven_repository\javax\servlet\jsp\jsp-api\2.1\jsp-api-2.1.jar;D:\softwares_install\maven_repository\com\sun\jersey\jersey-core\1.19\jersey-core-1.19.jar;D:\softwares_install\maven_repository\javax\ws\rs\jsr311-api\1.1.1\jsr311-api-1.1.1.jar;D:\softwares_install\maven_repository\com\sun\jersey\jersey-servlet\1.19\jersey-servlet-1.19.jar;D:\softwares_install\maven_repository\com\sun\jersey\jersey-json\1.19\jersey-json-1.19.jar;D:\softwares_install\maven_repository\org\codehaus\jettison\jettison\1.1\jettison-1.1.jar;D:\softwares_install\maven_repository\com\sun\xml\bind\jaxb-impl\2.2.3-1\jaxb-impl-2.2.3-1.jar;D:\softwares_install\maven_repository\org\codehaus\jackson\jackson-jaxrs\1.9.2\jackson-jaxrs-1.9.2.jar;D:\softwares_install\maven_repository\org\codehaus\jackson\jackson-xc\1.9.2\jackson-xc-1.9.2.jar;D:\softwares_install\maven_repository\com\sun\jersey\jersey-server\1.19\jersey-server-1.19.jar;D:\softwares_install\maven_repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\softwares_install\maven_repository\commons-beanutils\commons-beanutils\1.9.4\commons-beanutils-1.9.4.jar;D:\softwares_install\maven_repository\org\apache\commons\commons-configuration2\2.1.1\commons-configuration2-2.1.1.jar;D:\softwares_install\maven_repository\com\google\re2j\re2j\1.1\re2j-1.1.jar;D:\softwares_install\maven_repository\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar;D:\softwares_install\maven_repository\com\jcraft\jsch\0.1.55\jsch-0.1.55.jar;D:\softwares_install\maven_repository\org\apache\curator\curator-client\2.13.0\curator-client-2.13.0.jar;D:\softwares_install\maven_repository\org\apache\commons\commons-compress\1.19\commons-compress-1.19.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerb-simplekdc\1.0.1\kerb-simplekdc-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerb-client\1.0.1\kerb-client-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerby-config\1.0.1\kerby-config-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerb-core\1.0.1\kerb-core-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerby-pkix\1.0.1\kerby-pkix-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerby-asn1\1.0.1\kerby-asn1-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerby-util\1.0.1\kerby-util-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerb-common\1.0.1\kerb-common-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerb-crypto\1.0.1\kerb-crypto-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerb-util\1.0.1\kerb-util-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\token-provider\1.0.1\token-provider-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerb-admin\1.0.1\kerb-admin-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerb-server\1.0.1\kerb-server-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerb-identity\1.0.1\kerb-identity-1.0.1.jar;D:\softwares_install\maven_repository\org\apache\kerby\kerby-xdr\1.0.1\kerby-xdr-1.0.1.jar;D:\softwares_install\maven_repository\org\codehaus\woodstox\stax2-api\3.1.4\stax2-api-3.1.4.jar;D:\softwares_install\maven_repository\com\fasterxml\woodstox\woodstox-core\5.0.3\woodstox-core-5.0.3.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-hdfs\3.1.4\hadoop-hdfs-3.1.4.jar;D:\softwares_install\maven_repository\org\eclipse\jetty\jetty-util-ajax\9.4.20.v20190813\jetty-util-ajax-9.4.20.v20190813.jar;D:\softwares_install\maven_repository\commons-daemon\commons-daemon\1.0.13\commons-daemon-1.0.13.jar;D:\softwares_install\maven_repository\org\fusesource\leveldbjni\leveldbjni-all\1.8\leveldbjni-all-1.8.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-mapreduce-client-core\3.1.4\hadoop-mapreduce-client-core-3.1.4.jar;D:\softwares_install\maven_repository\org\apache\hadoop\hadoop-yarn-common\3.1.4\hadoop-yarn-common-3.1.4.jar;D:\softwares_install\maven_repository\com\sun\jersey\jersey-client\1.19\jersey-client-1.19.jar;D:\softwares_install\maven_repository\com\google\inject\guice\4.0\guice-4.0.jar;D:\softwares_install\maven_repository\javax\inject\javax.inject\1\javax.inject-1.jar;D:\softwares_install\maven_repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\softwares_install\maven_repository\com\sun\jersey\contribs\jersey-guice\1.19\jersey-guice-1.19.jar;D:\softwares_install\maven_repository\com\fasterxml\jackson\module\jackson-module-jaxb-annotations\2.9.10\jackson-module-jaxb-annotations-2.9.10.jar;D:\softwares_install\maven_repository\com\fasterxml\jackson\jaxrs\jackson-jaxrs-json-provider\2.9.10\jackson-jaxrs-json-provider-2.9.10.jar;D:\softwares_install\maven_repository\com\fasterxml\jackson\jaxrs\jackson-jaxrs-base\2.9.10\jackson-jaxrs-base-2.9.10.jar;D:\softwares_install\maven_repository\com\google\inject\extensions\guice-servlet\4.0\guice-servlet-4.0.jar;D:\softwares_install\maven_repository\org\testng\testng\7.4.0\testng-7.4.0.jar;D:\softwares_install\maven_repository\com\beust\jcommander\1.78\jcommander-1.78.jar;D:\softwares_install\maven_repository\org\webjars\jquery\3.5.1\jquery-3.5.1.jar;D:\softwares_install\maven_repository\log4j\log4j\1.2.17\log4j-1.2.17.jar" com.kkb.spark.sparkSql.ReadTextFile
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
21/05/25 16:46:32 INFO SparkContext: Running Spark version 2.3.3
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.security.HadoopKerberosName.setRuleMechanism(Ljava/lang/String;)V
at org.apache.hadoop.security.HadoopKerberosName.setConfiguration(HadoopKerberosName.java:84)
at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:318)
at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:303)
at org.apache.hadoop.security.UserGroupInformation.doSubjectLogin(UserGroupInformation.java:1827)
at org.apache.hadoop.security.UserGroupInformation.createLoginUser(UserGroupInformation.java:709)
at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:659)
at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:570)
at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2468)
at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2468)
at scala.Option.getOrElse(Option.scala:121)
at org.apache.spark.util.Utils$.getCurrentUserName(Utils.scala:2468)
at org.apache.spark.SparkContext.(SparkContext.scala:292)
at org.apache.spark.SparkContext$.getOrCreate(SparkContext.scala:2493)
at org.apache.spark.sql.SparkSession$Builder$$anonfun$7.apply(SparkSession.scala:934)
at org.apache.spark.sql.SparkSession$Builder$$anonfun$7.apply(SparkSession.scala:925)
at scala.Option.getOrElse(Option.scala:121)
at org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:925)
at com.kkb.spark.sparkSql.ReadTextFile$.main(ReadTextFile.scala:13)
at com.kkb.spark.sparkSql.ReadTextFile.main(ReadTextFile.scala)
Process finished with exit code 1
二、解决方案
在maven库中选择Hadoop版本号对应的Apache Hadoop Auth依赖,添加至pom.xml中后运行正常
org.apache.hadoop
hadoop-auth
3.1.4