问题描述
我正在尝试使用嵌入式集群式vertx启动Spring Boot webapp(可执行的war).它失败,但出现以下异常.
I am trying to start a Spring Boot webapp(executable war) with embedded clustered vertx.It fails with below exception.
java.lang.IllegalArgumentException: PortableFactory[-14] is already registered! com.hazelcast.concurrent.countdownlatch.client.CountDownLatchPortableHook$1@738ae532 -> com.hazelcast.concurrent.countdownlatch.client.CountDownLatchPortableHook$1@60d09d45
at com.hazelcast.nio.serialization.PortableHookLoader.register(PortableHookLoader.java:84)
at com.hazelcast.nio.serialization.PortableHookLoader.load(PortableHookLoader.java:51)
at com.hazelcast.nio.serialization.PortableHookLoader.<init>(PortableHookLoader.java:41)
at com.hazelcast.nio.serialization.SerializationServiceImpl.<init>(SerializationServiceImpl.java:126)
at com.hazelcast.nio.serialization.DefaultSerializationServiceBuilder.createSerializationService(DefaultSerializationServiceBuilder.java:221)
at com.hazelcast.nio.serialization.DefaultSerializationServiceBuilder.build(DefaultSerializationServiceBuilder.java:194)
at com.hazelcast.instance.DefaultNodeExtension.createSerializationService(DefaultNodeExtension.java:113)
at com.hazelcast.instance.Node.<init>(Node.java:160)
at com.hazelcast.instance.HazelcastInstanceImpl.<init>(HazelcastInstanceImpl.java:120)
at com.hazelcast.instance.HazelcastInstanceFactory.constructHazelcastInstance(HazelcastInstanceFactory.java:151)
at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:134)
at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:110)
at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:58)
at io.vertx.spi.cluster.hazelcast.HazelcastClusterManager.lambda$join$0(HazelcastClusterManager.java:138)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:259)
at io.vertx.core.impl.OrderedExecutorFactory$OrderedExecutor.lambda$new$0(OrderedExecutorFactory.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
如果您的类路径中有不同的hazelcast jar,则会发生这种情况.但是我确保没有其他版本.它仍然失败.我什至尝试排除可能会启动其自己实例的spring-boot HazelcastAutoConfiguration.class,但还是没有运气.
This happens if you have different hazelcast jars in you classpath. But I made sure i don't have any other version. It still fails.I even tried excluding spring-boot HazelcastAutoConfiguration.class which might start its own instance, but still no luck.
有任何线索吗?
推荐答案
此替代方法似乎正在起作用,创建用于使用Hazelcast的简单GlassFish服务失败
This workaround seems to be working-Creating a simple GlassFish service to use Hazelcast fails
这篇关于带有嵌入式vertx的Spring Boot Webapp无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!