我正在使用Docker部署vertx项目。我用
docker build -t <image_name> .
并运行
docker run -i -t <image_name>
命令。但是失败了。错误日志为:
java.lang.IllegalArgumentException: PortableFactory[-1] is already registered! com.hazelcast.spi.impl.SpiPortableHook$1@10798031 -> com.hazelcast.spi.impl.SpiPortableHook$1@53139743
at com.hazelcast.internal.serialization.impl.PortableHookLoader.register(PortableHookLoader.java:87)
at com.hazelcast.internal.serialization.impl.PortableHookLoader.load(PortableHookLoader.java:54)
at com.hazelcast.internal.serialization.impl.PortableHookLoader.<init>(PortableHookLoader.java:44)
at com.hazelcast.internal.serialization.impl.SerializationServiceV1.<init>(SerializationServiceV1.java:95)
at com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder.createSerializationService(DefaultSerializationServiceBuilder.java:267)
at com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder.build(DefaultSerializationServiceBuilder.java:221)
at com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder.build(DefaultSerializationServiceBuilder.java:49)
at com.hazelcast.instance.DefaultNodeExtension.createSerializationService(DefaultNodeExtension.java:151)
at com.hazelcast.instance.Node.<init>(Node.java:201)
at com.hazelcast.instance.HazelcastInstanceImpl.createNode(HazelcastInstanceImpl.java:159)
at com.hazelcast.instance.HazelcastInstanceImpl.<init>(HazelcastInstanceImpl.java:127)
at com.hazelcast.instance.HazelcastInstanceFactory.constructHazelcastInstance(HazelcastInstanceFactory.java:218)
at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:176)
at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:126)
at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:58)
at io.vertx.spi.cluster.hazelcast.HazelcastClusterManager.lambda$join$0(HazelcastClusterManager.java:159)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:273)
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
docker文件如下: