quarkus: Application start crashes when creating a infinispan cluster in 1.6.X

Describe the bug

Creating a clustered app (we need the eventbus to communicate and add some shared lock between different instances), choosing Infinispan as cluster manager (adding the dependency io.vertx:vertx-infinispan).

When the application starts, it throws a NoSuchMethodError trying to parse the default infinispan config file and the quarkus start crashes.

The dependency version is the one defined in the universe bom (vertx.version 3.9.2) https://github.com/quarkusio/quarkus/blob/master/bom/application/pom.xml#L106 which has defined the infinispan version 9.4.10.Final : https://github.com/vert-x3/vertx-infinispan/blob/3.9.2/pom.xml#L33

But in the quarkus universe bom the dependency version is overridden for the 10.1.5.Final https://github.com/quarkusio/quarkus/blob/master/bom/application/pom.xml#L125 (my educated guess is because of the infinispan-client extension needs them)

In the ParserRegistry class of the newer version there’s no method parse(InputStream is) which is invoked by the ClusterInfinispanManager for the configured file (see the stacktrace)

Expected behavior The application should start and look for an existent cluster with the default configuration

2020-07-21 16:45:54.595 INFO  [,,] 80514 --- [org.inf.CLUSTER] (vert.x-worker-thread-0) ISPN000094: Received new cluster view for channel ISPN: [juanzu-45490|1] (2) [juanzu-45490, juanzu-8256]
2020-07-21 16:45:54.609 INFO  [,,] 80514 --- [org.inf.rem.tra.jgr.JGroupsTransport] (vert.x-worker-thread-0) ISPN000079: Channel ISPN local address is juanzu-8256, physical addresses are [127.0.0.1:7800]

Actual behavior

The application does NOT start and crashes …

Caused by: java.lang.NoSuchMethodError: 'org.infinispan.configuration.parsing.ConfigurationBuilderHolder org.infinispan.configuration.parsing.ParserRegistry.parse(java.io.InputStream)'
	at io.vertx.ext.cluster.infinispan.InfinispanClusterManager.lambda$join$8(InfinispanClusterManager.java:228)
	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	... 1 more

Look at the end for the full stacktrace To Reproduce Steps to reproduce the behavior:

  1. Create a quarkus application, and add the dependency io.vertx:vertx-infinispan to the pom.
  2. Launch the application with the cluster properties -Dquarkus.vertx.cluster.clustered=true -Dquarkus.vertx.cluster.host=127.0.0.1 -Dquarkus.vertx.cluster.port=7800 -Djava.net.preferIPv4Stack=true
  3. The error is thrown and the application doesn’t start.

Configuration

# Add your application.properties here, if applicable.
quarkus.vertx.cluster.clustered=true

Mainly the only config value needed is the clustering enablement option.

Environment (please complete the following information):

  • Output of uname -a or ver: Linux juanzu.fedora 5.7.7-100.fc31.x86_64 #1 SMP Wed Jul 1 20:37:05 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Output of java -version:
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment 18.9 (build 11.0.7+10)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10, mixed mode, sharing)
  • GraalVM version (if different from Java):
  • Quarkus version or git rev: discovered in 1.6.0.Final but current master code is also affected
  • Build tool (ie. output of mvnw --version or gradlew --version):
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/jzuriaga/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
Java version: 11.0.7, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk-11.0.7.10-1.fc31.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.7.7-100.fc31.x86_64", arch: "amd64", family: "unix"

Additional context A workaround is to override the infinispan dependencies in the pom … then the application starts and the cluster is created.

...
    <infinispan.version>9.4.10.Final</infinispan.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${quarkus.platform.group-id}</groupId>
        <artifactId>${quarkus.platform.artifact-id}</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-core</artifactId>
        <version>${infinispan.version}</version>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-commons</artifactId>
        <version>${infinispan.version}</version>
      </dependency>
...

Full Stacktrace

Caused by: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:679)
	at io.quarkus.runtime.Application.start(Application.java:90)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:91)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:106)
	at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.runner.bootstrap.StartupActionImpl$3.run(StartupActionImpl.java:145)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.util.concurrent.CompletionException: java.lang.NoSuchMethodError: 'org.infinispan.configuration.parsing.ConfigurationBuilderHolder org.infinispan.configuration.parsing.ParserRegistry.parse(java.io.InputStream)'
	at java.base/java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:412)
	at java.base/java.util.concurrent.CompletableFuture.join(CompletableFuture.java:2044)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder.initialize(VertxCoreRecorder.java:119)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$VertxSupplier.get(VertxCoreRecorder.java:313)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$VertxSupplier.get(VertxCoreRecorder.java:300)
	at io.quarkus.vertx.runtime.VertxRecorder.configureVertx(VertxRecorder.java:36)
	at io.quarkus.deployment.steps.VertxProcessor$build-626852132.deploy_0(VertxProcessor$build-626852132.zig:130)
	at io.quarkus.deployment.steps.VertxProcessor$build-626852132.deploy(VertxProcessor$build-626852132.zig:36)
	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:538)
	... 12 more
Caused by: java.lang.NoSuchMethodError: 'org.infinispan.configuration.parsing.ConfigurationBuilderHolder org.infinispan.configuration.parsing.ParserRegistry.parse(java.io.InputStream)'
	at io.vertx.ext.cluster.infinispan.InfinispanClusterManager.lambda$join$8(InfinispanClusterManager.java:228)
	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	... 1 more

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 1
  • Comments: 18 (11 by maintainers)

Most upvoted comments

It’s not on the Quarkus roadmap. On the Vert.x side, we’re thinking about a cluster manager for Kubernetes which uses the ISPN client only. This one should work with Quarkus too.

Which version of Quarkus are you using?

Current 1.6.1.Final is using Vert.x 3.9.1.

@gsmet I’ve detected it in 1.6.0.Final and checked that in 1.6.1.Final is also happening.

My guess would be that Vert.x Infinispan is using an older version of the Infinispan client that we are using in Quarkus (10.1.5.Final).

Yes, the problem is the universe-bom is forcing the newer dependency.

@Serkan80 so it seems the issue isn’t related to config but to the way consumers are registered.

When a method is annotated with @ConsumeEvent("hello") the local attribute defaults to true and so the Vert.x consumer registration isn’t propagated to the other nodes.

Then due to a limitation of Vert.x 3, only the first registration of a specific address is propagated to an address, but only if it’s not a local one.

And in Quarkus annotated consumers are registered before any method of your bean is invoked.

This is why no consumer is recorded in the cluster manager at all.

Change the annotation to @ConsumeEvent(value = "hello", local = false) and it should work. At least it works on my machine with vertx-infinispan CM (with all POM workarounds).