hazelcast version issue with vertx 4

304 views
Skip to first unread message

Jonad García San Martín

unread,
Feb 11, 2021, 1:01:43 AM2/11/21
to vert.x
Hello group,

In my company we are migrating from vert.x 3.X to 4.X. version 4.0.2 uses vertx-hazelcast 4.0.2 but we have all configured with hazelcast 3.12.2 because we had vertx 3.9.4. I am trying to use the old configuration to connect with our hazelcast server that it is working fine.

I followed https://vertx.io/docs/vertx-hazelcast/java/#_using_a_different_hazelcast_version instructions and my pom looks like this:

                <dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
<version>3.12.2</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-hazelcast</artifactId>
<version>4.0.2</version>
</dependency>

But when I try to run the application throws this exception. I want to known if it is possible to use hazelcast 3.X with vertx 4.0.2. Thanks.

Exception:

Exception in thread "main" java.lang.NoClassDefFoundError: com/hazelcast/cluster/MembershipListener
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1209)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1220)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
at io.vertx.core.ServiceHelper.loadFactories(ServiceHelper.java:55)
at io.vertx.core.ServiceHelper.loadFactories(ServiceHelper.java:42)
at io.vertx.core.ServiceHelper.loadFactoryOrNull(ServiceHelper.java:32)
at io.vertx.core.impl.VertxFactory.createClusterManager(VertxFactory.java:100)
at io.vertx.core.impl.VertxFactory.clusteredVertx(VertxFactory.java:84)
at io.vertx.core.Vertx.clusteredVertx(Vertx.java:98)
at io.vertx.core.impl.launcher.commands.ClasspathHandler.create(ClasspathHandler.java:132)
at io.vertx.core.impl.launcher.commands.BareCommand.startVertx(BareCommand.java:252)
at io.vertx.core.impl.launcher.commands.BareCommand.run(BareCommand.java:190)
at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:249)
at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:248)
at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:383)
at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:346)
at io.vertx.core.Launcher.main(Launcher.java:45)
at com.XXX.Main.main(Main.java:226)
Caused by: java.lang.ClassNotFoundException: com.hazelcast.cluster.MembershipListener
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 31 more

Thomas SEGISMONT

unread,
Feb 11, 2021, 4:41:17 AM2/11/21
to vert.x
Hi,

Vert.x 4 is not compatible with Hazelcast 3.X. You must use Hazelcast 4.X

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/83f1e22e-0dcd-4ba3-9920-88d9eef69186n%40googlegroups.com.

Jonad García San Martín

unread,
Feb 11, 2021, 11:41:04 AM2/11/21
to vert.x
Thank you for the fast response.

Umberto D'Ovidio

unread,
Aug 23, 2022, 3:41:55 AM8/23/22
to vert.x
Hi, we have a similar issue when migrating from Vert.x 3 to Vert.x 4.
Unfortunately using Hazelcast 4.X is not an option for us, since we are using Orientdb, which uses Hazelcast 3.

One option would be to use separate cluster managers, so that orientdb would use Hazelcast 3 and Vert.x a different cluster manager,
but we might run into potential headaches if the cluster managers are not in sync.

Another option I'm considering is to implement the Vert.x cluster 4 spi with Hazelcast 3.
Do you foresee any problems with this approach?

Thomas SEGISMONT

unread,
Aug 23, 2022, 5:00:56 AM8/23/22
to ve...@googlegroups.com
You should be able to implement the Vert.x 4 clustering SPI with Hazelcast 3.

We don't do it because we only support Hazelcast 4.

Reply all
Reply to author
Forward
0 new messages