报错Caused by: javax.servlet.UnavailableException: Servlet class org.glassfish.jersey.servlet.ServletContainer is not a javax.servlet.Servlet

版本依赖:
<properties>
<java.version>17</java.version>
<springboot.version>3.0.4</springboot.version>
<scala.version>2.12.15</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<spark.version>3.3.2</spark.version>
<jackson.version>2.13.2.2</jackson.version>
<janino.version>3.0.16</janino.version>
<hadoop.version>3.3.4</hadoop.version>
<commons-pool2.version>2.8.0</commons-pool2.version>
<fasterxml.jackson.version>2.10.5</fasterxml.jackson.version>
<javacsv.version>2.0</javacsv.version>
</properties>解决方案:
直接关掉spark-ui,简单粗暴
sparkConf.set("spark.ui.enabled","false");
如下
SparkConf sparkConf = new SparkConf();
sparkConf.set("spark.ui.enabled","false");
SparkSession sparkSession = SparkSession
.builder()
.master("local[*]")
.appName("syncUpdate")
.config(sparkConf)
.getOrCreate();
文章讨论了一个在使用SpringBoot和Spark时遇到的错误,具体是由于ServletContainer类未被正确识别为Servlet导致的UnavailableException。作者提供的解决方案是关闭Spark的用户界面(SparkUI),通过设置spark.ui.enabled为false来避免该问题。
505

被折叠的 条评论
为什么被折叠?



