Jet client in quarkus cli applicaiton connected to remote cluster throwing HazelcastSerializationException
priyanknarvekar opened this issue · 1 comments
priyanknarvekar commented
I have a jet cluster running on kubernetes, and connecting to it from a cli application on quarkus runtime (https://quarkus.io/guides/picocli).
import javax.inject.Inject;
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.jet.Jet;
import com.hazelcast.jet.JetInstance;
import com.hazelcast.jet.Job;
import picocli.CommandLine;
@CommandLine.Command
public class HelloCommand implements Runnable {
String cacert = "-----BEGIN CERTIFICATE-----........-----END CERTIFICATE-----";
@Inject HZJob hzjob;
@Override
public void run() {
ClientConfig config = new ClientConfig();
config.setClusterName("jet");
config.getNetworkConfig().getKubernetesConfig().setEnabled(true)
.setProperty("api-token", "<api-token>")
.setProperty("ca-certificate", cacert)
.setProperty("namespace", "services")
.setProperty("kubernetes-master", "https://kubernetes.default.svc.cluster.local")
.setProperty("service-name", "hazelcast-jet");
JetInstance jet = Jet.newJetClient(config);
Job job = jet.newJob(hzjob.getPipeline(),hzjob.getConfig());
job.join();
}
}
running this results in a HazelcastSerializationException.
com.hazelcast.nio.serialization.HazelcastSerializationException: java.io.IOException: unknown protocol: quarkus
at com.hazelcast.internal.serialization.impl.SerializationUtil.handleException(SerializationUtil.java:103)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.readObject(AbstractSerializationService.java:295)
at com.hazelcast.internal.serialization.impl.ByteArrayObjectDataInput.readObject(ByteArrayObjectDataInput.java:592)
at com.hazelcast.internal.serialization.impl.defaultserializers.AbstractMapStreamSerializer.deserializeEntries(AbstractMapStreamSerializer.java:46)
at com.hazelcast.internal.serialization.impl.defaultserializers.LinkedHashMapStreamSerializer.read(LinkedHashMapStreamSerializer.java:44)
at com.hazelcast.internal.serialization.impl.defaultserializers.LinkedHashMapStreamSerializer.read(LinkedHashMapStreamSerializer.java:32)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:44)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.readObject(AbstractSerializationService.java:289)
at com.hazelcast.internal.serialization.impl.ByteArrayObjectDataInput.readObject(ByteArrayObjectDataInput.java:592)
at com.hazelcast.jet.config.JobConfig.readData(JobConfig.java:1155)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.readInternal(DataSerializableSerializer.java:160)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.read(DataSerializableSerializer.java:106)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.read(DataSerializableSerializer.java:51)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:44)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.toObject(AbstractSerializationService.java:208)
at com.hazelcast.jet.impl.JobCoordinationService.lambda$submitJob$1(JobCoordinationService.java:193)
at com.hazelcast.jet.impl.JobCoordinationService.lambda$submitToCoordinatorThread$46(JobCoordinationService.java:1039)
at com.hazelcast.jet.impl.JobCoordinationService.lambda$submitToCoordinatorThread$47(JobCoordinationService.java:1060)
at com.hazelcast.internal.util.executor.CompletableFutureTask.run(CompletableFutureTask.java:64)
at com.hazelcast.internal.util.executor.CachedExecutorServiceDelegate$Worker.run(CachedExecutorServiceDelegate.java:217)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.lang.Thread.run(Thread.java:833)
at com.hazelcast.internal.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)
at com.hazelcast.internal.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:102)
Caused by: java.io.IOException: unknown protocol: quarkus
at java.net.URL.readObject(URL.java:1549)
at jdk.internal.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:568)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1231)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2434)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2268)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1744)
at java.io.ObjectInputStream$FieldValues.<init>(ObjectInputStream.java:2617)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2468)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2268)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1744)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:514)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:472)
at com.hazelcast.internal.serialization.impl.defaultserializers.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:86)
at com.hazelcast.internal.serialization.impl.defaultserializers.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:79)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:44)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.readObject(AbstractSerializationService.java:289)
... 23 more
priyanknarvekar commented
closing since not seeing the exception anymore, not sure what changed though !