Exception in thread “main“ java.lang.NoClassDefFoundError: javax/servlet/Servlet

这篇具有很好参考价值的文章主要介绍了Exception in thread “main“ java.lang.NoClassDefFoundError: javax/servlet/Servlet。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

记录一次Spark提交错误

源程序

import org.apache.spark.sql.SparkSession

import scala.io.Source

object SparkClear {


  def main(args: Array[String]): Unit = {

    val spark =SparkSession.builder().appName("SparkClear").master( "local[*]").getOrCreate()

    val symbolicList=Source.fromFile("D:\\IDEA\\科大讯飞大数据培训\\bigdataproject\\src\\main\\resources\\symbolic.txt").getLines().toList

    val stopWordList=Source.fromFile("D:\\IDEA\\科大讯飞大数据培训\\bigdataproject\\src\\main\\resources\\stopwords.txt").getLines().toList

    import spark.implicits._

    val file=spark.read.options(Map(("delimiter","|"),("header","false")))
      .csv("D:\\IDEA\\科大讯飞大数据培训\\bigdataproject\\src\\main\\resources\\wordcount").toDF("no","content")

    val ds=file.select("content").as[String]
    ds.show()

    ds.flatMap(_.split(" "))
      .map(_.toLowerCase)
      .filter(!stopWordList.contains(_))
      .filter(!symbolicList.contains(_))
      .groupBy("value")
      .count()
      .orderBy($"count"desc)
      .show(50)
    spark.stop()
  }

}

错误

D:\jdk1.8\bin\java.exe "-javaagent:D:\IDEA\2021.2.3\ideaIU-2021.3\IntelliJ IDEA 2021.3\lib\idea_rt.jar=53469:D:\IDEA\2021.2.3\ideaIU-2021.3\IntelliJ IDEA 2021.3\bin" -Dfile.encoding=UTF-8 -classpath D:\jdk1.8\jre\lib\charsets.jar;D:\jdk1.8\jre\lib\deploy.jar;D:\jdk1.8\jre\lib\ext\access-bridge-64.jar;D:\jdk1.8\jre\lib\ext\cldrdata.jar;D:\jdk1.8\jre\lib\ext\dnsns.jar;D:\jdk1.8\jre\lib\ext\jaccess.jar;D:\jdk1.8\jre\lib\ext\jfxrt.jar;D:\jdk1.8\jre\lib\ext\localedata.jar;D:\jdk1.8\jre\lib\ext\nashorn.jar;D:\jdk1.8\jre\lib\ext\sunec.jar;D:\jdk1.8\jre\lib\ext\sunjce_provider.jar;D:\jdk1.8\jre\lib\ext\sunmscapi.jar;D:\jdk1.8\jre\lib\ext\sunpkcs11.jar;D:\jdk1.8\jre\lib\ext\zipfs.jar;D:\jdk1.8\jre\lib\javaws.jar;D:\jdk1.8\jre\lib\jce.jar;D:\jdk1.8\jre\lib\jfr.jar;D:\jdk1.8\jre\lib\jfxswt.jar;D:\jdk1.8\jre\lib\jsse.jar;D:\jdk1.8\jre\lib\management-agent.jar;D:\jdk1.8\jre\lib\plugin.jar;D:\jdk1.8\jre\lib\resources.jar;D:\jdk1.8\jre\lib\rt.jar;D:\IDEA\科大讯飞大数据培训\bigdataproject\target\classes;C:\Users\蒋欢\.m2\repository\org\scala-lang\scala-library\2.11.8\scala-library-2.11.8.jar;C:\Users\蒋欢\.m2\repository\org\scala-lang\scala-reflect\2.11.8\scala-reflect-2.11.8.jar;D:\localRepository\org\springframework\spring-context\5.2.8.RELEASE\spring-context-5.2.8.RELEASE.jar;D:\localRepository\org\springframework\spring-aop\5.2.8.RELEASE\spring-aop-5.2.8.RELEASE.jar;D:\localRepository\org\springframework\spring-beans\5.2.8.RELEASE\spring-beans-5.2.8.RELEASE.jar;D:\localRepository\org\springframework\spring-core\5.2.8.RELEASE\spring-core-5.2.8.RELEASE.jar;D:\localRepository\org\springframework\spring-jcl\5.2.8.RELEASE\spring-jcl-5.2.8.RELEASE.jar;D:\localRepository\org\springframework\spring-expression\5.2.8.RELEASE\spring-expression-5.2.8.RELEASE.jar;D:\localRepository\org\aspectj\aspectjweaver\1.8.7\aspectjweaver-1.8.7.jar;D:\localRepository\taglibs\standard\1.1.2\standard-1.1.2.jar;D:\localRepository\org\springframework\spring-jdbc\5.2.8.RELEASE\spring-jdbc-5.2.8.RELEASE.jar;D:\localRepository\org\springframework\spring-tx\5.2.8.RELEASE\spring-tx-5.2.8.RELEASE.jar;D:\localRepository\org\springframework\spring-test\5.2.8.RELEASE\spring-test-5.2.8.RELEASE.jar;D:\localRepository\org\mybatis\mybatis\3.5.5\mybatis-3.5.5.jar;D:\localRepository\org\mybatis\mybatis-spring\2.0.5\mybatis-spring-2.0.5.jar;D:\localRepository\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar;D:\localRepository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;D:\localRepository\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar;D:\localRepository\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar;D:\localRepository\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\localRepository\org\springframework\spring-web\5.2.8.RELEASE\spring-web-5.2.8.RELEASE.jar;D:\localRepository\org\springframework\spring-webmvc\5.2.8.RELEASE\spring-webmvc-5.2.8.RELEASE.jar;D:\localRepository\org\hibernate\hibernate-validator\5.4.3.Final\hibernate-validator-5.4.3.Final.jar;D:\localRepository\javax\validation\validation-api\1.1.0.Final\validation-api-1.1.0.Final.jar;D:\localRepository\org\jboss\logging\jboss-logging\3.3.0.Final\jboss-logging-3.3.0.Final.jar;D:\localRepository\com\fasterxml\classmate\1.3.1\classmate-1.3.1.jar;D:\localRepository\com\alibaba\fastjson\1.2.73\fastjson-1.2.73.jar;D:\localRepository\com\fasterxml\jackson\core\jackson-core\2.9.0\jackson-core-2.9.0.jar;D:\localRepository\com\fasterxml\jackson\core\jackson-databind\2.9.0\jackson-databind-2.9.0.jar;D:\localRepository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;D:\localRepository\org\apache\spark\spark-core_2.11\2.1.3\spark-core_2.11-2.1.3.jar;D:\localRepository\org\apache\avro\avro-mapred\1.7.7\avro-mapred-1.7.7-hadoop2.jar;D:\localRepository\org\apache\avro\avro-ipc\1.7.7\avro-ipc-1.7.7.jar;D:\localRepository\org\apache\avro\avro\1.7.7\avro-1.7.7.jar;D:\localRepository\org\apache\avro\avro-ipc\1.7.7\avro-ipc-1.7.7-tests.jar;D:\localRepository\org\codehaus\jackson\jackson-core-asl\1.9.13\jackson-core-asl-1.9.13.jar;D:\localRepository\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar;D:\localRepository\com\twitter\chill_2.11\0.8.0\chill_2.11-0.8.0.jar;D:\localRepository\com\esotericsoftware\kryo-shaded\3.0.3\kryo-shaded-3.0.3.jar;D:\localRepository\com\esotericsoftware\minlog\1.3.0\minlog-1.3.0.jar;D:\localRepository\org\objenesis\objenesis\2.1\objenesis-2.1.jar;D:\localRepository\com\twitter\chill-java\0.8.0\chill-java-0.8.0.jar;D:\localRepository\org\apache\xbean\xbean-asm5-shaded\4.4\xbean-asm5-shaded-4.4.jar;D:\localRepository\org\apache\hadoop\hadoop-client\2.2.0\hadoop-client-2.2.0.jar;D:\localRepository\org\apache\hadoop\hadoop-common\2.2.0\hadoop-common-2.2.0.jar;D:\localRepository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;D:\localRepository\org\apache\commons\commons-math\2.1\commons-math-2.1.jar;D:\localRepository\xmlenc\xmlenc\0.52\xmlenc-0.52.jar;D:\localRepository\commons-lang\commons-lang\2.5\commons-lang-2.5.jar;D:\localRepository\commons-configuration\commons-configuration\1.6\commons-configuration-1.6.jar;D:\localRepository\commons-digester\commons-digester\1.8\commons-digester-1.8.jar;D:\localRepository\commons-beanutils\commons-beanutils-core\1.8.0\commons-beanutils-core-1.8.0.jar;D:\localRepository\com\google\protobuf\protobuf-java\2.5.0\protobuf-java-2.5.0.jar;D:\localRepository\org\apache\hadoop\hadoop-auth\2.2.0\hadoop-auth-2.2.0.jar;D:\localRepository\org\apache\commons\commons-compress\1.4.1\commons-compress-1.4.1.jar;D:\localRepository\org\tukaani\xz\1.0\xz-1.0.jar;D:\localRepository\org\apache\hadoop\hadoop-hdfs\2.2.0\hadoop-hdfs-2.2.0.jar;D:\localRepository\org\mortbay\jetty\jetty-util\6.1.26\jetty-util-6.1.26.jar;D:\localRepository\org\apache\hadoop\hadoop-mapreduce-client-app\2.2.0\hadoop-mapreduce-client-app-2.2.0.jar;D:\localRepository\org\apache\hadoop\hadoop-mapreduce-client-common\2.2.0\hadoop-mapreduce-client-common-2.2.0.jar;D:\localRepository\org\apache\hadoop\hadoop-yarn-client\2.2.0\hadoop-yarn-client-2.2.0.jar;D:\localRepository\com\google\inject\guice\3.0\guice-3.0.jar;D:\localRepository\javax\inject\javax.inject\1\javax.inject-1.jar;D:\localRepository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\localRepository\org\apache\hadoop\hadoop-yarn-server-common\2.2.0\hadoop-yarn-server-common-2.2.0.jar;D:\localRepository\org\apache\hadoop\hadoop-mapreduce-client-shuffle\2.2.0\hadoop-mapreduce-client-shuffle-2.2.0.jar;D:\localRepository\org\apache\hadoop\hadoop-yarn-api\2.2.0\hadoop-yarn-api-2.2.0.jar;D:\localRepository\org\apache\hadoop\hadoop-mapreduce-client-core\2.2.0\hadoop-mapreduce-client-core-2.2.0.jar;D:\localRepository\org\apache\hadoop\hadoop-yarn-common\2.2.0\hadoop-yarn-common-2.2.0.jar;D:\localRepository\org\apache\hadoop\hadoop-mapreduce-client-jobclient\2.2.0\hadoop-mapreduce-client-jobclient-2.2.0.jar;D:\localRepository\org\apache\hadoop\hadoop-annotations\2.2.0\hadoop-annotations-2.2.0.jar;D:\localRepository\org\apache\spark\spark-launcher_2.11\2.1.3\spark-launcher_2.11-2.1.3.jar;D:\localRepository\org\apache\spark\spark-network-common_2.11\2.1.3\spark-network-common_2.11-2.1.3.jar;D:\localRepository\org\fusesource\leveldbjni\leveldbjni-all\1.8\leveldbjni-all-1.8.jar;D:\localRepository\org\apache\spark\spark-network-shuffle_2.11\2.1.3\spark-network-shuffle_2.11-2.1.3.jar;D:\localRepository\org\apache\spark\spark-unsafe_2.11\2.1.3\spark-unsafe_2.11-2.1.3.jar;D:\localRepository\net\java\dev\jets3t\jets3t\0.7.1\jets3t-0.7.1.jar;D:\localRepository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;D:\localRepository\org\apache\curator\curator-recipes\2.4.0\curator-recipes-2.4.0.jar;D:\localRepository\org\apache\curator\curator-framework\2.4.0\curator-framework-2.4.0.jar;D:\localRepository\org\apache\curator\curator-client\2.4.0\curator-client-2.4.0.jar;D:\localRepository\org\apache\zookeeper\zookeeper\3.4.5\zookeeper-3.4.5.jar;D:\localRepository\org\apache\commons\commons-math3\3.4.1\commons-math3-3.4.1.jar;D:\localRepository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;D:\localRepository\org\slf4j\slf4j-api\1.7.16\slf4j-api-1.7.16.jar;D:\localRepository\org\slf4j\jul-to-slf4j\1.7.16\jul-to-slf4j-1.7.16.jar;D:\localRepository\org\slf4j\jcl-over-slf4j\1.7.16\jcl-over-slf4j-1.7.16.jar;D:\localRepository\org\slf4j\slf4j-log4j12\1.7.16\slf4j-log4j12-1.7.16.jar;D:\localRepository\com\ning\compress-lzf\1.0.3\compress-lzf-1.0.3.jar;D:\localRepository\org\xerial\snappy\snappy-java\1.1.2.6\snappy-java-1.1.2.6.jar;D:\localRepository\net\jpountz\lz4\lz4\1.3.0\lz4-1.3.0.jar;D:\localRepository\org\roaringbitmap\RoaringBitmap\0.5.11\RoaringBitmap-0.5.11.jar;D:\localRepository\commons-net\commons-net\2.2\commons-net-2.2.jar;D:\localRepository\org\scala-lang\scala-library\2.11.8\scala-library-2.11.8.jar;D:\localRepository\org\json4s\json4s-jackson_2.11\3.2.11\json4s-jackson_2.11-3.2.11.jar;D:\localRepository\org\json4s\json4s-core_2.11\3.2.11\json4s-core_2.11-3.2.11.jar;D:\localRepository\org\json4s\json4s-ast_2.11\3.2.11\json4s-ast_2.11-3.2.11.jar;D:\localRepository\org\scala-lang\scalap\2.11.0\scalap-2.11.0.jar;D:\localRepository\org\scala-lang\scala-compiler\2.11.0\scala-compiler-2.11.0.jar;D:\localRepository\org\scala-lang\modules\scala-xml_2.11\1.0.1\scala-xml_2.11-1.0.1.jar;D:\localRepository\org\scala-lang\modules\scala-parser-combinators_2.11\1.0.1\scala-parser-combinators_2.11-1.0.1.jar;D:\localRepository\org\glassfish\jersey\core\jersey-client\2.22.2\jersey-client-2.22.2.jar;D:\localRepository\javax\ws\rs\javax.ws.rs-api\2.0.1\javax.ws.rs-api-2.0.1.jar;D:\localRepository\org\glassfish\hk2\hk2-api\2.4.0-b34\hk2-api-2.4.0-b34.jar;D:\localRepository\org\glassfish\hk2\hk2-utils\2.4.0-b34\hk2-utils-2.4.0-b34.jar;D:\localRepository\org\glassfish\hk2\external\aopalliance-repackaged\2.4.0-b34\aopalliance-repackaged-2.4.0-b34.jar;D:\localRepository\org\glassfish\hk2\external\javax.inject\2.4.0-b34\javax.inject-2.4.0-b34.jar;D:\localRepository\org\glassfish\hk2\hk2-locator\2.4.0-b34\hk2-locator-2.4.0-b34.jar;D:\localRepository\org\javassist\javassist\3.18.1-GA\javassist-3.18.1-GA.jar;D:\localRepository\org\glassfish\jersey\core\jersey-common\2.22.2\jersey-common-2.22.2.jar;D:\localRepository\javax\annotation\javax.annotation-api\1.2\javax.annotation-api-1.2.jar;D:\localRepository\org\glassfish\jersey\bundles\repackaged\jersey-guava\2.22.2\jersey-guava-2.22.2.jar;D:\localRepository\org\glassfish\hk2\osgi-resource-locator\1.0.1\osgi-resource-locator-1.0.1.jar;D:\localRepository\org\glassfish\jersey\core\jersey-server\2.22.2\jersey-server-2.22.2.jar;D:\localRepository\org\glassfish\jersey\media\jersey-media-jaxb\2.22.2\jersey-media-jaxb-2.22.2.jar;D:\localRepository\org\glassfish\jersey\containers\jersey-container-servlet\2.22.2\jersey-container-servlet-2.22.2.jar;D:\localRepository\org\glassfish\jersey\containers\jersey-container-servlet-core\2.22.2\jersey-container-servlet-core-2.22.2.jar;D:\localRepository\io\netty\netty-all\4.0.43.Final\netty-all-4.0.43.Final.jar;D:\localRepository\io\netty\netty\3.8.0.Final\netty-3.8.0.Final.jar;D:\localRepository\com\clearspring\analytics\stream\2.7.0\stream-2.7.0.jar;D:\localRepository\io\dropwizard\metrics\metrics-core\3.1.2\metrics-core-3.1.2.jar;D:\localRepository\io\dropwizard\metrics\metrics-jvm\3.1.2\metrics-jvm-3.1.2.jar;D:\localRepository\io\dropwizard\metrics\metrics-json\3.1.2\metrics-json-3.1.2.jar;D:\localRepository\io\dropwizard\metrics\metrics-graphite\3.1.2\metrics-graphite-3.1.2.jar;D:\localRepository\org\apache\ivy\ivy\2.4.0\ivy-2.4.0.jar;D:\localRepository\oro\oro\2.0.8\oro-2.0.8.jar;D:\localRepository\net\razorvine\pyrolite\4.13\pyrolite-4.13.jar;D:\localRepository\net\sf\py4j\py4j\0.10.7\py4j-0.10.7.jar;D:\localRepository\org\apache\spark\spark-tags_2.11\2.1.3\spark-tags_2.11-2.1.3.jar;D:\localRepository\org\apache\commons\commons-crypto\1.0.0\commons-crypto-1.0.0.jar;D:\localRepository\org\spark-project\spark\unused\1.0.0\unused-1.0.0.jar;D:\localRepository\org\apache\spark\spark-mllib_2.11\2.1.1\spark-mllib_2.11-2.1.1.jar;D:\localRepository\org\apache\spark\spark-streaming_2.11\2.1.1\spark-streaming_2.11-2.1.1.jar;D:\localRepository\org\apache\spark\spark-sql_2.11\2.1.1\spark-sql_2.11-2.1.1.jar;D:\localRepository\com\univocity\univocity-parsers\2.2.1\univocity-parsers-2.2.1.jar;D:\localRepository\org\apache\spark\spark-sketch_2.11\2.1.1\spark-sketch_2.11-2.1.1.jar;D:\localRepository\org\apache\spark\spark-catalyst_2.11\2.1.1\spark-catalyst_2.11-2.1.1.jar;D:\localRepository\org\codehaus\janino\janino\3.0.0\janino-3.0.0.jar;D:\localRepository\org\codehaus\janino\commons-compiler\3.0.0\commons-compiler-3.0.0.jar;D:\localRepository\org\antlr\antlr4-runtime\4.5.3\antlr4-runtime-4.5.3.jar;D:\localRepository\org\apache\parquet\parquet-column\1.8.1\parquet-column-1.8.1.jar;D:\localRepository\org\apache\parquet\parquet-common\1.8.1\parquet-common-1.8.1.jar;D:\localRepository\org\apache\parquet\parquet-encoding\1.8.1\parquet-encoding-1.8.1.jar;D:\localRepository\org\apache\parquet\parquet-hadoop\1.8.1\parquet-hadoop-1.8.1.jar;D:\localRepository\org\apache\parquet\parquet-format\2.3.0-incubating\parquet-format-2.3.0-incubating.jar;D:\localRepository\org\apache\parquet\parquet-jackson\1.8.1\parquet-jackson-1.8.1.jar;D:\localRepository\org\apache\spark\spark-graphx_2.11\2.1.1\spark-graphx_2.11-2.1.1.jar;D:\localRepository\com\github\fommil\netlib\core\1.1.2\core-1.1.2.jar;D:\localRepository\net\sourceforge\f2j\arpack_combined_all\0.1\arpack_combined_all-0.1.jar;D:\localRepository\org\apache\spark\spark-mllib-local_2.11\2.1.1\spark-mllib-local_2.11-2.1.1.jar;D:\localRepository\org\scalanlp\breeze_2.11\0.12\breeze_2.11-0.12.jar;D:\localRepository\org\scalanlp\breeze-macros_2.11\0.12\breeze-macros_2.11-0.12.jar;D:\localRepository\net\sf\opencsv\opencsv\2.3\opencsv-2.3.jar;D:\localRepository\com\github\rwl\jtransforms\2.4.0\jtransforms-2.4.0.jar;D:\localRepository\org\spire-math\spire_2.11\0.7.4\spire_2.11-0.7.4.jar;D:\localRepository\org\spire-math\spire-macros_2.11\0.7.4\spire-macros_2.11-0.7.4.jar;D:\localRepository\com\chuusai\shapeless_2.11\2.0.0\shapeless_2.11-2.0.0.jar;D:\localRepository\com\fasterxml\jackson\module\jackson-module-scala_2.11\2.9.0\jackson-module-scala_2.11-2.9.0.jar;D:\localRepository\org\scala-lang\scala-reflect\2.11.8\scala-reflect-2.11.8.jar;D:\localRepository\com\fasterxml\jackson\module\jackson-module-paranamer\2.9.0\jackson-module-paranamer-2.9.0.jar;D:\localRepository\com\thoughtworks\paranamer\paranamer\2.8\paranamer-2.8.jar;D:\localRepository\commons-io\commons-io\2.7\commons-io-2.7.jar;D:\localRepository\commons-fileupload\commons-fileupload\1.4\commons-fileupload-1.4.jar;D:\localRepository\org\apache\shiro\shiro-core\1.6.0\shiro-core-1.6.0.jar;D:\localRepository\org\apache\shiro\shiro-lang\1.6.0\shiro-lang-1.6.0.jar;D:\localRepository\org\apache\shiro\shiro-cache\1.6.0\shiro-cache-1.6.0.jar;D:\localRepository\org\apache\shiro\shiro-crypto-hash\1.6.0\shiro-crypto-hash-1.6.0.jar;D:\localRepository\org\apache\shiro\shiro-crypto-core\1.6.0\shiro-crypto-core-1.6.0.jar;D:\localRepository\org\apache\shiro\shiro-crypto-cipher\1.6.0\shiro-crypto-cipher-1.6.0.jar;D:\localRepository\org\apache\shiro\shiro-config-core\1.6.0\shiro-config-core-1.6.0.jar;D:\localRepository\org\apache\shiro\shiro-config-ogdl\1.6.0\shiro-config-ogdl-1.6.0.jar;D:\localRepository\commons-beanutils\commons-beanutils\1.9.4\commons-beanutils-1.9.4.jar;D:\localRepository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\localRepository\org\apache\shiro\shiro-event\1.6.0\shiro-event-1.6.0.jar;D:\localRepository\jstl\jstl\1.2\jstl-1.2.jar;D:\localRepository\com\github\pagehelper\pagehelper\5.2.0\pagehelper-5.2.0.jar;D:\localRepository\com\github\jsqlparser\jsqlparser\3.2\jsqlparser-3.2.jar;D:\localRepository\org\jpmml\pmml-evaluator\1.4.3\pmml-evaluator-1.4.3.jar;D:\localRepository\com\google\guava\guava\25.1-jre\guava-25.1-jre.jar;D:\localRepository\org\jpmml\pmml-evaluator-extension\1.4.3\pmml-evaluator-extension-1.4.3.jar;D:\localRepository\org\jpmml\pmml-model\1.4.5\pmml-model-1.4.5.jar;D:\localRepository\org\jpmml\pmml-agent\1.4.5\pmml-agent-1.4.5.jar;D:\localRepository\commons-codec\commons-codec\1.6\commons-codec-1.6.jar;D:\localRepository\org\apache\commons\commons-lang3\3.8.1\commons-lang3-3.8.1.jar SparkClear
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
22/07/29 12:01:32 INFO SparkContext: Running Spark version 2.1.3
22/07/29 12:01:33 INFO SecurityManager: Changing view acls to: FleChazo
22/07/29 12:01:33 INFO SecurityManager: Changing modify acls to: FleChazo
22/07/29 12:01:33 INFO SecurityManager: Changing view acls groups to: 
22/07/29 12:01:33 INFO SecurityManager: Changing modify acls groups to: 
22/07/29 12:01:33 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users  with view permissions: Set(FleChazo); groups with view permissions: Set(); users  with modify permissions: Set(FleChazo); groups with modify permissions: Set()
22/07/29 12:01:33 INFO Utils: Successfully started service 'sparkDriver' on port 53509.
22/07/29 12:01:33 INFO SparkEnv: Registering MapOutputTracker
22/07/29 12:01:33 INFO SparkEnv: Registering BlockManagerMaster
22/07/29 12:01:33 INFO BlockManagerMasterEndpoint: Using org.apache.spark.storage.DefaultTopologyMapper for getting topology information
22/07/29 12:01:33 INFO BlockManagerMasterEndpoint: BlockManagerMasterEndpoint up
22/07/29 12:01:33 INFO DiskBlockManager: Created local directory at D:\temp\blockmgr-d16bb832-5199-4b21-96c4-1bfc349cd02b
22/07/29 12:01:34 INFO MemoryStore: MemoryStore started with capacity 1982.4 MB
22/07/29 12:01:34 INFO SparkEnv: Registering OutputCommitCoordinator
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
	at org.apache.spark.ui.WebUI.attachPage(WebUI.scala:81)
	at org.apache.spark.ui.WebUI$$anonfun$attachTab$1.apply(WebUI.scala:65)
	at org.apache.spark.ui.WebUI$$anonfun$attachTab$1.apply(WebUI.scala:65)
	at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at org.apache.spark.ui.WebUI.attachTab(WebUI.scala:65)
	at org.apache.spark.ui.SparkUI.initialize(SparkUI.scala:66)
	at org.apache.spark.ui.SparkUI.<init>(SparkUI.scala:82)
	at org.apache.spark.ui.SparkUI$.create(SparkUI.scala:220)
	at org.apache.spark.ui.SparkUI$.createLiveUI(SparkUI.scala:162)
	at org.apache.spark.SparkContext.<init>(SparkContext.scala:452)
	at org.apache.spark.SparkContext$.getOrCreate(SparkContext.scala:2323)
	at org.apache.spark.sql.SparkSession$Builder$$anonfun$6.apply(SparkSession.scala:868)
	at org.apache.spark.sql.SparkSession$Builder$$anonfun$6.apply(SparkSession.scala:860)
	at scala.Option.getOrElse(Option.scala:121)
	at org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:860)
	at SparkClear$.main(SparkClear.scala:10)
	at SparkClear.main(SparkClear.scala)
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 18 more
22/07/29 12:01:34 INFO DiskBlockManager: Shutdown hook called
22/07/29 12:01:34 INFO ShutdownHookManager: Shutdown hook called
22/07/29 12:01:34 INFO ShutdownHookManager: Deleting directory D:\temp\spark-42a06475-3a36-485b-9791-26949831afe6\userFiles-a2c6dcdb-a347-4532-a3b3-7ae2367e1a46
22/07/29 12:01:34 INFO ShutdownHookManager: Deleting directory D:\temp\spark-42a06475-3a36-485b-9791-26949831afe6

Process finished with exit code 1

原因

  • 缺少jar包
  • jar包冲突

解决方法

先查看pom文件中是否引入了对应的依赖,如果没有的话,需要引入:

<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>3.1.0</version>
</dependency>

特别注意!!!

如果是从Maven Repository上面获取的依赖记得要删除<scop>这一行,我就是网上找了几百种方法,才发现是这个问题!文章来源地址https://www.toymoban.com/news/detail-536454.html

到了这里,关于Exception in thread “main“ java.lang.NoClassDefFoundError: javax/servlet/Servlet的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

原文地址:https://blog.csdn.net/qq_40608132/article/details/126052945

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包