Compiling maven multi-module project fails with IncompatibleClassChangeError

I need to migrated an existing application that compiled just fine based on Spring-Boot 2.7.16 and Vaadin 23.3.25 to a recent version of Spring Boot (3.5.4) and Vaadin(24.8.5). Any attempt to compile with the new versions of Spring Boot and Vaadin fails during build-frontend with the following error message when running maven -Pproduction compile:

`
[ERROR] The build process encountered an error: class com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor has interface org.objectweb.asm.ClassVisitor as super class
[ERROR] To diagnose the issue, please re-run Maven with the -X option to enable detailed debug logging and identify the root cause.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.237 s
[INFO] Finished at: 2025-08-05T14:11:52+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:24.8.5:build-frontend (default) on project : null: MojoFailureException: InvocationTargetException: class com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor has interface org.objectweb.asm.ClassVisitor as super class → [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.vaadin:vaadin-maven-plugin:24.8.5:build-frontend (default) on project : null

…

Caused by: java.lang.IncompatibleClassChangeError: class com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor has interface org.objectweb.asm.ClassVisitor as super class
`

Neither searching google nor investigating on stackexchange or in the Vaadin forums did provide insightful details.

Anyone any ideas?

Which JDK are you using to compile? Vaadin 24 requires at least Java 17

I’m using JDK 21 (OpenJDK).

Can you please run maven with -X flag and post the logs?

Your project could be using an asm version older than the one supported by the Vaadin Maven plugin. A list of potential incompatible dependencies should be shown when the build fails.

The relevant part of the output of mvn -X... will follow… If you need something else, let me know. Just wanted to keep the information to the bare minimum…

Summary: The plugin reports quite a few “incompatibilities” when running “build-frontend”. One of them is org.ow2.asm:asm (project version 7.0, plugin version 9.8). I already tried overwriting with version 9.8 in the project, but that did not solve the isssue - of course, assuming I did the overwrite correctly. At least the incompatibility for asm wasn’t reported when I did it.

`
…
[INFO] — vaadin:24.8.5:build-frontend (default) @ —
[DEBUG] Loading mojo com.vaadin:vaadin-maven-plugin:24.8.5:build-frontend from plugin realm ClassRealm[plugin>com.vaadin:vaadin-maven-plugin:24.8.5, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@70dea4e]
[DEBUG] Configuring mojo execution ‘com.vaadin:vaadin-maven-plugin:24.8.5:build-frontend:default’ with basic configurator →
[DEBUG] (f) applicationProperties = \src\main\resources\application.properties
[DEBUG] (f) bunEnable = false
[DEBUG] (f) ciBuild = false
[DEBUG] (f) cleanFrontendFiles = true
[DEBUG] (f) forceProductionBuild = false
[DEBUG] (f) frontend = \src\main\frontend
[DEBUG] (f) frontendDirectory = \src\main\frontend
[DEBUG] (f) frontendExtraFileExtensions =
[DEBUG] (f) frontendIgnoreVersionChecks = false
[DEBUG] (f) frontendResourcesDirectory = \src\main\resources\META-INF\resources\frontend
[DEBUG] (f) generateBundle = true
[DEBUG] (f) generateEmbeddableWebComponents = true
[DEBUG] (f) javaResourceFolder = \src\main\resources
[DEBUG] (f) javaSourceFolder = \src\main\java
[DEBUG] (f) mojoExecution = com.vaadin:vaadin-maven-plugin:24.8.5:build-frontend {execution: default}
[DEBUG] (f) node = node
[DEBUG] (f) nodeAutoUpdate = true
[DEBUG] (f) nodeVersion = v22.17.0
[DEBUG] (f) npmExcludeWebComponents = false
[DEBUG] (f) npmFolder =
[DEBUG] (f) openApiJsonFile = \target\generated-resources\openapi.json
[DEBUG] (f) optimizeBundle = true
[DEBUG] (f) pnpmEnable = false
[DEBUG] (f) postinstallPackages =
[DEBUG] (f) project = MavenProject: de.dsgvoehk::202508-SNAPSHOT @ \pom.xml
[DEBUG] (f) projectBasedir =
[DEBUG] (f) projectBuildDir = \target
[DEBUG] (f) requireHomeNodeExec = false
[DEBUG] (f) resourceOutputDirectory = \target\classes\META-INF\VAADIN
[DEBUG] (f) runNpmInstall = true
[DEBUG] (f) skipDevBundleRebuild = false
[DEBUG] (f) useGlobalPnpm = false
[DEBUG] (f) webpackOutputDirectory = \target\classes\META-INF\VAADIN\webapp
[DEBUG] – end configuration –
[DEBUG] Using cached Reflector for plugin com.vaadin:vaadin-maven-plugin and phase compile
[DEBUG] Auto-detected client-side router to use: react-router
[DEBUG] Auto-detected client-side router to use: react-router
[DEBUG] Loading properties from file ‘\src\main\resources\vaadin-featureflags.properties’
[INFO] Scanning classes to find frontend configurations and dependencies…
[WARNING] Found dependencies defined with different versions in project and Vaadin maven plugin.
Project dependencies are used, but plugin execution could fail if the versions are incompatible.
In case of build failure please analyze the project dependencies and update versions or configure exclusions for potential offending transitive dependencies.
You can use ‘mvn dependency:tree -Dincludes=groupId:artifactId’ to detect where the dependency is defined in the project.

com.fasterxml.jackson.core:jackson-core:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.core:jackson-databind:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.core:jackson-annotations:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar: project version [2.19.2], plugin version [2.19.1]
org.jsoup:jsoup:jar: project version [1.11.3], plugin version [1.20.1]
org.ow2.asm:asm:jar: project version [7.0], plugin version [9.8]
org.apache.commons:commons-compress:jar: project version [1.28.0], plugin version [1.27.1]
commons-codec:commons-codec:jar: project version [1.18.0], plugin version [1.17.1]
org.apache.commons:commons-lang3:jar: project version [3.17.0], plugin version [3.16.0]
org.apache.commons:commons-text:jar: project version [1.6], plugin version [1.13.1]
io.github.classgraph:classgraph:jar: project version [4.8.163], plugin version [4.8.179]
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.module:jackson-module-parameter-names:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar: project version [2.19.2], plugin version [2.19.1]
io.swagger.core.v3:swagger-annotations-jakarta:jar: project version [2.2.22], plugin version [2.2.32]
jakarta.xml.bind:jakarta.xml.bind-api:jar: project version [4.0.2], plugin version [3.0.1]
com.sun.activation:jakarta.activation:jar: project version [1.2.1], plugin version [2.0.1]
org.springframework.data:spring-data-commons:jar: project version [3.5.2], plugin version [3.5.1]
org.springframework:spring-beans:jar: project version [6.2.9], plugin version [6.2.8]
org.springframework:spring-core:jar: project version [6.2.9], plugin version [6.2.8]
org.springframework:spring-jcl:jar: project version [6.2.9], plugin version [6.2.8]
[ERROR] The build process encountered an error: class com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor has interface org.objectweb.asm.ClassVisitor as super class
[ERROR] To diagnose the issue, please re-run Maven with the -X option to enable detailed debug logging and identify the root cause.
…
`

ASM version could be the problem. Ypu need to check your project dependencies and make it sure is uses a compatible ASM verson (at least 9.8)

I have updated the pom - for all dependencies - to use at least the versions used by the plugin, i.e. in the output of mvn -X ... the project version is alway higher than the plugin version. For asm I have changed the version to exactly 9.8. Therefore, it’s not in the list of differing versions.

The project I am building depends on a library of mine which contains a module called vaadin-ui. This module provides basic functionality for creating the Vaadin UI in the project (base classes, custom components). Is it possible that the error results from the library build and not the project build?

Here is the mvn output:

`
[DEBUG] Found dependencies defined with different versions in project and Vaadin maven plugin.
Project dependencies are used, but plugin execution could fail if the versions are incompatible.
In case of build failure please analyze the project dependencies and update versions or configure exclusions for potential offending transitive dependencies.
You can use ‘mvn dependency:tree -Dincludes=groupId:artifactId’ to detect where the dependency is defined in the project.

com.fasterxml.jackson.core:jackson-core:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.core:jackson-databind:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.core:jackson-annotations:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar: project version [2.19.2], plugin version [2.19.1]
org.apache.commons:commons-compress:jar: project version [1.28.0], plugin version [1.27.1]
commons-codec:commons-codec:jar: project version [1.18.0], plugin version [1.17.1]
org.apache.commons:commons-lang3:jar: project version [3.17.0], plugin version [3.16.0]
org.apache.commons:commons-text:jar: project version [1.14.0], plugin version [1.13.1]
io.github.classgraph:classgraph:jar: project version [4.8.181], plugin version [4.8.179]
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.module:jackson-module-parameter-names:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar: project version [2.19.2], plugin version [2.19.1]
io.swagger.core.v3:swagger-annotations-jakarta:jar: project version [2.2.35], plugin version [2.2.32]
jakarta.xml.bind:jakarta.xml.bind-api:jar: project version [4.0.2], plugin version [3.0.1]
org.springframework.data:spring-data-commons:jar: project version [3.5.2], plugin version [3.5.1]
org.springframework:spring-beans:jar: project version [6.2.9], plugin version [6.2.8]
org.springframework:spring-core:jar: project version [6.2.9], plugin version [6.2.8]
org.springframework:spring-jcl:jar: project version [6.2.9], plugin version [6.2.8]
[INFO]
[INFO] — vaadin:24.8.5:build-frontend (default) @ —
[DEBUG] Loading mojo com.vaadin:vaadin-maven-plugin:24.8.5:build-frontend from plugin realm ClassRealm[plugin>com.vaadin:vaadin-maven-plugin:24.8.5, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@70dea4e]
[DEBUG] Configuring mojo execution ‘com.vaadin:vaadin-maven-plugin:24.8.5:build-frontend:default’ with basic configurator →
[DEBUG] (f) applicationProperties = \src\main\resources\application.properties
[DEBUG] (f) bunEnable = false
[DEBUG] (f) ciBuild = false
[DEBUG] (f) cleanFrontendFiles = true
[DEBUG] (f) forceProductionBuild = false
[DEBUG] (f) frontend = \src\main\frontend
[DEBUG] (f) frontendDirectory = \src\main\frontend
[DEBUG] (f) frontendExtraFileExtensions =
[DEBUG] (f) frontendIgnoreVersionChecks = false
[DEBUG] (f) frontendResourcesDirectory = \src\main\resources\META-INF\resources\frontend
[DEBUG] (f) generateBundle = true
[DEBUG] (f) generateEmbeddableWebComponents = true
[DEBUG] (f) javaResourceFolder = \src\main\resources
[DEBUG] (f) javaSourceFolder = \src\main\java
[DEBUG] (f) mojoExecution = com.vaadin:vaadin-maven-plugin:24.8.5:build-frontend {execution: default}
[DEBUG] (f) node = node
[DEBUG] (f) nodeAutoUpdate = true
[DEBUG] (f) nodeVersion = v22.17.0
[DEBUG] (f) npmExcludeWebComponents = false
[DEBUG] (f) npmFolder =
[DEBUG] (f) openApiJsonFile = \target\generated-resources\openapi.json
[DEBUG] (f) optimizeBundle = true
[DEBUG] (f) pnpmEnable = false
[DEBUG] (f) postinstallPackages =
[DEBUG] (f) project = MavenProject: de.dsgvoehk::202508-SNAPSHOT @ \pom.xml
[DEBUG] (f) projectBasedir =
[DEBUG] (f) projectBuildDir = \target
[DEBUG] (f) requireHomeNodeExec = false
[DEBUG] (f) resourceOutputDirectory = \target\classes\META-INF\VAADIN
[DEBUG] (f) runNpmInstall = true
[DEBUG] (f) skipDevBundleRebuild = false
[DEBUG] (f) useGlobalPnpm = false
[DEBUG] (f) webpackOutputDirectory = \target\classes\META-INF\VAADIN\webapp
[DEBUG] – end configuration –
[DEBUG] Using cached Reflector for plugin com.vaadin:vaadin-maven-plugin and phase compile
[DEBUG] Auto-detected client-side router to use: react-router
[DEBUG] Auto-detected client-side router to use: react-router
[DEBUG] Loading properties from file ‘\src\main\resources\vaadin-featureflags.properties’
[INFO] Scanning classes to find frontend configurations and dependencies…
[WARNING] Found dependencies defined with different versions in project and Vaadin maven plugin.
Project dependencies are used, but plugin execution could fail if the versions are incompatible.
In case of build failure please analyze the project dependencies and update versions or configure exclusions for potential offending transitive dependencies.
You can use ‘mvn dependency:tree -Dincludes=groupId:artifactId’ to detect where the dependency is defined in the project.

com.fasterxml.jackson.core:jackson-core:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.core:jackson-databind:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.core:jackson-annotations:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar: project version [2.19.2], plugin version [2.19.1]
org.apache.commons:commons-compress:jar: project version [1.28.0], plugin version [1.27.1]
commons-codec:commons-codec:jar: project version [1.18.0], plugin version [1.17.1]
org.apache.commons:commons-lang3:jar: project version [3.17.0], plugin version [3.16.0]
org.apache.commons:commons-text:jar: project version [1.14.0], plugin version [1.13.1]
io.github.classgraph:classgraph:jar: project version [4.8.181], plugin version [4.8.179]
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.module:jackson-module-parameter-names:jar: project version [2.19.2], plugin version [2.19.1]
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar: project version [2.19.2], plugin version [2.19.1]
io.swagger.core.v3:swagger-annotations-jakarta:jar: project version [2.2.35], plugin version [2.2.32]
jakarta.xml.bind:jakarta.xml.bind-api:jar: project version [4.0.2], plugin version [3.0.1]
org.springframework.data:spring-data-commons:jar: project version [3.5.2], plugin version [3.5.1]
org.springframework:spring-beans:jar: project version [6.2.9], plugin version [6.2.8]
org.springframework:spring-core:jar: project version [6.2.9], plugin version [6.2.8]
org.springframework:spring-jcl:jar: project version [6.2.9], plugin version [6.2.8]
[ERROR] The build process encountered an error: class com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor has interface org.objectweb.asm.ClassVisitor as super class
[ERROR] To diagnose the issue, please re-run Maven with the -X option to enable detailed debug logging and identify the root cause.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.943 s
[INFO] Finished at: 2025-08-06T06:54:58+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:24.8.5:build-frontend (default) on project : null: MojoFailureException: InvocationTargetException: class com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor has interface org.objectweb.asm.ClassVisitor as super class → [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.vaadin:vaadin-maven-plugin:24.8.5:build-frontend (default) on project : null
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.MojoFailureException
at com.vaadin.flow.plugin.maven.FlowModeAbstractMojo.execute (FlowModeAbstractMojo.java:331)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:118)
at java.lang.reflect.Method.invoke (Method.java:580)
at com.vaadin.flow.plugin.maven.FlowModeAbstractMojo.execute (FlowModeAbstractMojo.java:324)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.lang.IncompatibleClassChangeError: class com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor has interface org.objectweb.asm.ClassVisitor as super class
at java.lang.ClassLoader.defineClass1 (Native Method)
at java.lang.ClassLoader.defineClass (ClassLoader.java:1027)
at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:150)
at java.net.URLClassLoader.defineClass (URLClassLoader.java:524)
at java.net.URLClassLoader$1.run (URLClassLoader.java:427)
at java.net.URLClassLoader$1.run (URLClassLoader.java:421)
at java.security.AccessController.doPrivileged (AccessController.java:714)
at java.net.URLClassLoader.findClass (URLClassLoader.java:420)
at java.lang.ClassLoader.loadClass (ClassLoader.java:593)
at java.lang.ClassLoader.loadClass (ClassLoader.java:526)
at com.vaadin.flow.plugin.maven.Reflector$ReflectorClassLoader.loadClass (Reflector.java:448)
at com.vaadin.flow.server.frontend.scanner.FrontendDependencies.computeEagerRouteConfiguration (FrontendDependencies.java:736)
at com.vaadin.flow.server.frontend.scanner.FrontendDependencies. (FrontendDependencies.java:174)
at com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner$FrontendDependenciesScannerFactory.createScanner (FrontendDependenciesScanner.java:133)
at com.vaadin.flow.plugin.maven.BuildFrontendMojo.executeInternal (BuildFrontendMojo.java:157)
at com.vaadin.hilla.maven.BuildFrontendMojo.executeInternal (BuildFrontendMojo.java:65)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at com.vaadin.flow.plugin.maven.FlowModeAbstractMojo.execute (FlowModeAbstractMojo.java:324)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)

`

There is still something weird here: looking at the ASM 9.8, ClassVisitor is an abstract class,not an interface. Could it be that some of your dependencies are shading an old ASM version?

Can you provide the output of mvn dependency:tree?

The output of mvn dependency:tree is long… Therefore, I created an excerpt with the sections referencing asm. There are only those references…

[INFO] <project-name>:jar:<project-version>
...
[INFO] +- <module-name>:<module-version>:compile
...
[INFO] |  +- org.apache.commons:commons-digester3:jar:3.2:compile
[INFO] |  |  +- cglib:cglib:jar:2.2.2:compile
[INFO] |  |  |  \- asm:asm:jar:3.3.1:compile
[INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] |  |  \- commons-logging:commons-logging:jar:1.1.1:compile
...
[INFO] +- org.ow2.asm:asm:jar:9.8:compile
...

I make use of Apache’s commons-digester3 - latest version 3.2 - which has an indirect dependency on asm version 3.3.1 for processing XML configuration files.

Should you need more context, let me know.

Good catch. You should try to exclude the asm:asm:3.3.1 transitive dependency from commons-digester.
However, I can’t say if commons-digester (or better its cglib dependency) could be compatible with newer ASM.

An alternative could be to use the with-deps classifier for commons-digester. This version seems to shade and repackage ASM also, so it should not conflict with the newer version.

<dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-digester3</artifactId>
  <version>3.2</version>
  <classifier>with-deps</classifier>
</dependency>
2 Likes

I have excluded asm:asm for commons-digester3 in the module. The module and project now compile successfully. Thank you! Will see whether it behaves as expected.

The issue seems to be resolved. Thank you, Marco! While still struggling with some other aspects of migration to the latest versions of Spring and Vaadin, I can now move forward.