当前位置: 首页 > 工具软件 > Google Spark > 使用案例 >

spring-boot+spark+spark-submit提交时出现compatible version of com.google.gson.GsonBuilder或javax.validatio

孟哲
2023-12-01

 

 

出现如下错误时

20/01/30 01:40:14 ERROR [localhost].[/]: Failed to destroy the filter named [Tomcat WebSocket (JSR356) Filter] of type [org.apache.tomcat.websocket.server.WsFilter]
java.lang.AbstractMethodError
	at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:301)
	at org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:4523)
	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5323)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1445)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1434)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1001)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1445)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1434)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1001)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:474)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:791)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.startup.Tomcat.stop(Tomcat.java:380)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.stopTomcat(TomcatWebServer.java:250)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.stop(TomcatWebServer.java:306)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.stopAndReleaseWebServer(ServletWebServerApplicationContext.java:309)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
	at com.best.spark.Application$.main(Application.scala:9)
	at com.best.spark.Application.main(Application.scala)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:738)
	at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:187)
	at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:212)
	at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:126)
	at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
20/01/30 01:40:14 INFO logging.ConditionEvaluationReportLoggingListener: 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
20/01/30 01:40:14 ERROR diagnostics.LoggingFailureAnalysisReporter: 

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method javax.validation.BootstrapConfiguration.getClockProviderClassName()Ljava/lang/String; but it does not exist. Its class, javax.validation.BootstrapConfiguration, is available from the following locations:

    jar:file:/usr/local/src/spark-2.1.0-bin-hadoop2.6/jars/validation-api-1.1.0.Final.jar!/javax/validation/BootstrapConfiguration.class
    jar:file:/sunxj/spark-web-interface-1.0-SNAPSHOT.jar!/javax/validation/BootstrapConfiguration.class

It was loaded from the following location:

    file:/usr/local/src/spark-2.1.0-bin-hadoop2.6/jars/validation-api-1.1.0.Final.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of javax.validation.BootstrapConfiguration

20/01/30 01:40:14 INFO util.ShutdownHookManager: Shutdown hook called
20/01/30 01:40:14 INFO util.ShutdownHookManager: Deleting directory /usr/local/src/spark-2.1.0-bin-hadoop2.6/spark-774ba164-2033-408a-8a86-19beafa7681a

20/01/30 01:45:01 INFO core.StandardService: Stopping service [Tomcat]
20/01/30 01:45:01 ERROR [localhost].[/]: Failed to destroy the filter named [Tomcat WebSocket (JSR356) Filter] of type [org.apache.tomcat.websocket.server.WsFilter]
java.lang.AbstractMethodError
	at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:301)
	at org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:4523)
	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5323)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1445)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1434)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1001)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1445)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1434)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1001)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:474)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:791)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.startup.Tomcat.stop(Tomcat.java:380)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.stopTomcat(TomcatWebServer.java:250)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.stop(TomcatWebServer.java:306)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.stopAndReleaseWebServer(ServletWebServerApplicationContext.java:309)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
	at com.best.spark.Application$.main(Application.scala:9)
	at com.best.spark.Application.main(Application.scala)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:738)
	at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:187)
	at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:212)
	at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:126)
	at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
20/01/30 01:45:01 INFO logging.ConditionEvaluationReportLoggingListener: 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
20/01/30 01:45:01 ERROR diagnostics.LoggingFailureAnalysisReporter: 

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder; but it does not exist. Its class, com.google.gson.GsonBuilder, is available from the following locations:

    jar:file:/usr/local/src/spark-2.1.0-bin-hadoop2.6/jars/gson-2.2.4.jar!/com/google/gson/GsonBuilder.class

It was loaded from the following location:

    file:/usr/local/src/spark-2.1.0-bin-hadoop2.6/jars/gson-2.2.4.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of com.google.gson.GsonBuilder

20/01/30 01:45:01 INFO util.ShutdownHookManager: Shutdown hook called
20/01/30 01:45:01 INFO util.ShutdownHookManager: Deleting directory /usr/local/src/spark-2.1.0-bin-hadoop2.6/spark-2bc74e34-528f-4c25-bd2e-073f2d27533c

这是由于validation-api-1.1.0.Final.jar和gson-2.2.4.jar版本比较旧了,只需要将validation-api-1.1.0.Final.jar更新到validation-api-2.0.1.Final.jar和gson-2.2.4.jar更新到gson-2.8.5.jar即可,然后将/usr/local/src/spark-2.1.0-bin-hadoop2.6/jars/目录中对应的文件删除并将新版的jar放到该目录即可。

 

 类似资料: