From 3d9c711a41b4d8758510f35391c5bfa6ca5daac7 Mon Sep 17 00:00:00 2001 From: gdliu3 Date: Wed, 12 Jul 2023 10:25:47 +0800 Subject: [PATCH] fix class not found exception --- .../server/rest/RestHttpGetCommandProcessor.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpGetCommandProcessor.java b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpGetCommandProcessor.java index 1540f99c986..6c71ac2feb3 100644 --- a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpGetCommandProcessor.java +++ b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpGetCommandProcessor.java @@ -22,6 +22,7 @@ import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.ObjectMapper; import org.apache.seatunnel.engine.common.Constant; +import org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader; import org.apache.seatunnel.engine.core.dag.logical.LogicalDag; import org.apache.seatunnel.engine.core.job.JobImmutableInformation; import org.apache.seatunnel.engine.core.job.JobInfo; @@ -42,6 +43,7 @@ import com.hazelcast.internal.json.JsonValue; import com.hazelcast.internal.util.JsonUtil; import com.hazelcast.internal.util.StringUtil; +import com.hazelcast.jet.impl.execution.init.CustomClassLoadedObject; import com.hazelcast.map.IMap; import com.hazelcast.spi.impl.NodeEngine; @@ -227,12 +229,14 @@ private JsonObject convertToJson(JobInfo jobInfo, long jobId) { .getNodeEngine() .getSerializationService() .toObject(jobInfo.getJobImmutableInformation())); + + ClassLoader classLoader = + new SeaTunnelChildFirstClassLoader(jobImmutableInformation.getPluginJarsUrls()); LogicalDag logicalDag = - this.textCommandService - .getNode() - .getNodeEngine() - .getSerializationService() - .toObject(jobImmutableInformation.getLogicalDag()); + CustomClassLoadedObject.deserializeWithCustomClassLoader( + this.textCommandService.getNode().getNodeEngine().getSerializationService(), + classLoader, + jobImmutableInformation.getLogicalDag()); String jobMetrics = getSeaTunnelServer().getCoordinatorService().getJobMetrics(jobId).toJsonString();