[Bug] loader constraint violation: loader (instance of org/apache/flink/util/ChildFirstClassLoader) previously initiated loading for a different type with name "org/apache/streampark/flink/core/StreamTableContext" #2170
[X] I had searched in the issues and found no similar issues.
What happened
我使用docker-compose部署,配置好flink版本及flink集群之后,更改默认项目的flink版本及运行模式为remote。启动flink是出现以下错误:
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/flink/util/ChildFirstClassLoader) previously initiated loading for a different type with name "org/apache/streampark/flink/core/StreamTableContext"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
StreamPark Version
docker apache/streampark:latest
Java Version
1.8
Flink Version
flink:1.14.6-scala_2.12
Scala Version of Flink
flink:1.14.6-scala_2.12
Error Exception
java.util.concurrent.CompletionException: java.lang.reflect.InvocationTargetException
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1606)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.reflect.InvocationTargetException
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.streampark.flink.submit.FlinkSubmitter$.$anonfun$submit$1(FlinkSubmitter.scala:56)
at org.apache.streampark.flink.proxy.FlinkShimsProxy$.$anonfun$proxy$1(FlinkShimsProxy.scala:68)
at org.apache.streampark.common.util.ClassLoaderUtils$.runAsClassLoader(ClassLoaderUtils.scala:39)
at org.apache.streampark.flink.proxy.FlinkShimsProxy$.proxy(FlinkShimsProxy.scala:68)
at org.apache.streampark.flink.submit.FlinkSubmitter$.submit(FlinkSubmitter.scala:51)
at org.apache.streampark.flink.submit.FlinkSubmitter.submit(FlinkSubmitter.scala)
at org.apache.streampark.console.core.service.impl.ApplicationServiceImpl.lambda$start$8(ApplicationServiceImpl.java:1477)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
... 3 more
Caused by: org.apache.flink.client.program.ProgramInvocationException: The program caused an error:
Classpath: [file:/opt/streampark_workspace/workspace/100000/streampark-flinkjob_Flink_SQL_Demo.jar]
System.out: (none)
System.err: (none)
at org.apache.flink.client.program.PackagedProgramUtils.generateException(PackagedProgramUtils.java:264)
at org.apache.flink.client.program.PackagedProgramUtils.getPipelineFromProgram(PackagedProgramUtils.java:172)
at org.apache.flink.client.program.PackagedProgramUtils.createJobGraph(PackagedProgramUtils.java:82)
at org.apache.streampark.flink.submit.trait.FlinkSubmitTrait.getJobGraph(FlinkSubmitTrait.scala:178)
at org.apache.streampark.flink.submit.trait.FlinkSubmitTrait.getJobGraph$(FlinkSubmitTrait.scala:161)
at org.apache.streampark.flink.submit.impl.RemoteSubmit$.jobGraphSubmit(RemoteSubmit.scala:117)
at org.apache.streampark.flink.submit.impl.RemoteSubmit$.$anonfun$doSubmit$2(RemoteSubmit.scala:47)
at org.apache.streampark.flink.submit.trait.FlinkSubmitTrait.$anonfun$trySubmit$5(FlinkSubmitTrait.scala:151)
at scala.util.Try$.apply(Try.scala:209)
at org.apache.streampark.flink.submit.trait.FlinkSubmitTrait.$anonfun$trySubmit$3(FlinkSubmitTrait.scala:151)
at scala.util.Failure.getOrElse(Try.scala:218)
at org.apache.streampark.flink.submit.trait.FlinkSubmitTrait.trySubmit(FlinkSubmitTrait.scala:149)
at org.apache.streampark.flink.submit.trait.FlinkSubmitTrait.trySubmit$(FlinkSubmitTrait.scala:141)
at org.apache.streampark.flink.submit.impl.RemoteSubmit$.doSubmit(RemoteSubmit.scala:47)
at org.apache.streampark.flink.submit.trait.FlinkSubmitTrait.submit(FlinkSubmitTrait.scala:111)
at org.apache.streampark.flink.submit.trait.FlinkSubmitTrait.submit$(FlinkSubmitTrait.scala:59)
at org.apache.streampark.flink.submit.impl.RemoteSubmit$.submit(RemoteSubmit.scala:36)
at org.apache.streampark.flink.submit.FlinkSubmit$.submit(FlinkSubmit.scala:29)
at org.apache.streampark.flink.submit.FlinkSubmit.submit(FlinkSubmit.scala)
... 15 more
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/flink/util/ChildFirstClassLoader) previously initiated loading for a different type with name "org/apache/streampark/flink/core/StreamTableContext"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at org.apache.flink.util.ChildFirstClassLoader.loadClassWithoutExceptionHandling(ChildFirstClassLoader.java:71)
at org.apache.flink.util.FlinkUserCodeClassLoader.loadClass(FlinkUserCodeClassLoader.java:48)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at org.apache.streampark.flink.cli.SqlClient$StreamSqlApp$.handle(SqlClient.scala:64)
at org.apache.streampark.flink.core.scala.FlinkStreamTable.main(FlinkStreamTable.scala:47)
at org.apache.streampark.flink.core.scala.FlinkStreamTable.main$(FlinkStreamTable.scala:44)
at org.apache.streampark.flink.cli.SqlClient$StreamSqlApp$.main(SqlClient.scala:63)
at org.apache.streampark.flink.cli.SqlClient$.delayedEndpoint$org$apache$streampark$flink$cli$SqlClient$1(SqlClient.scala:55)
at org.apache.streampark.flink.cli.SqlClient$delayedInit$body.apply(SqlClient.scala:30)
at scala.Function0.apply$mcV$sp(Function0.scala:34)
at scala.Function0.apply$mcV$sp$(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App.$anonfun$main$1$adapted(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:388)
at scala.App.main(App.scala:76)
at scala.App.main$(App.scala:74)
at org.apache.streampark.flink.cli.SqlClient$.main(SqlClient.scala:30)
at org.apache.streampark.flink.cli.SqlClient.main(SqlClient.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.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:355)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:222)
at org.apache.flink.client.program.PackagedProgramUtils.getPipelineFromProgram(PackagedProgramUtils.java:158)
... 32 more
Search before asking
What happened
我使用docker-compose部署,配置好flink版本及flink集群之后,更改默认项目的flink版本及运行模式为remote。启动flink是出现以下错误: Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/flink/util/ChildFirstClassLoader) previously initiated loading for a different type with name "org/apache/streampark/flink/core/StreamTableContext" at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
StreamPark Version
docker apache/streampark:latest
Java Version
1.8
Flink Version
flink:1.14.6-scala_2.12
Scala Version of Flink
flink:1.14.6-scala_2.12
Error Exception
Screenshots
No response
Are you willing to submit PR?
Code of Conduct