Vaadin 24.9 / Java 25 - vaadin-maven-plugin - Fails with "class file version 69"

Hi Team,

I am attempting to update our codebase to use Vaadin 24.9.0 on Java 25. Now the good news is if I build it and run the application in development mode, everything works as expected.

However, when I attempt to build on Java 25 with mvn clean install -Pproduction I get a failure in the vaadin-maven-plugin plugin.

The relevant stacktrace is:

Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 69
    at org.objectweb.asm.ClassReader.<init> (ClassReader.java:200)
    at org.objectweb.asm.ClassReader.<init> (ClassReader.java:180)
    at org.objectweb.asm.ClassReader.<init> (ClassReader.java:166)
    at org.objectweb.asm.ClassReader.<init> (ClassReader.java:288)
    at com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor.visitClass (FrontendAnnotatedClassVisitor.java:104)
    at com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor.visit (FrontendAnnotatedClassVisitor.java:116)

(would have been nice if it also showed me which class was causing the issue)

At first I thought this was because my project itself was compiling to Java 25 class versions (which I take it the org.objectweb.asm library you link to doesn’t support yet). But with some further debugging I was able to isolate where it was throwing the error:

As you can see this is deep inside the JVM. Which means I cannot use Java 25 to invoke the vaadin-maven-plugin plugin.

For now, I will carry on building the project with Java 21 and deploying on Java 25. Though would appreciate if you could have a look and suggest a workaround, or update the library.

Thanks,

If you define asm in your pom with a more recent version you can workaround this.

1 Like

Actually Vaadin uses asm 9.8 that supports Java 25.
Can you please double check the build logs to verify that your project isn’t providing an old version?

BTW, if you run maven with -X flag you should get more info about the failure

Very useful responses to this, thanks everyone.

By putting in (hacking) a reference to the latest ASM library I was able to resolve this:

<dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
            <version>9.8</version>
        </dependency>

Looking at dependencies pulling in the old asm version, there is quite a few (not least an older version of SpringBoot).

Can’t wait until everyone adopts this: JEP 484: Class-File API
All this classfile black magic in frameworks is always such a pain to debug when upgrading.

Note that we recommend using Spring Boot 3.5 with Vaadin 24.9 and that Spring Boot version should already have an ASM version that works with Java 25.

Indeed - though it has to be a specific version of SpringBoot 3.5 → 3.5.6

We were on 3.5.3 before and that pulls in the wrong ASM version.

1 Like
mvn dependency:tree -Dincludes="org.ow2.asm:asm"

spring-boot-starter-test:jar:3.5.6:test
 \- net.minidev:json-smart:jar:2.5.2:test
    \- net.minidev:accessors-smart:jar:2.5.2:test
       \- org.ow2.asm:asm:jar:9.7.1:compile

looks like spring-boot-starter-test using an older version of “asm” so compilation with vaadin-maven-plugin fails with vaadin 24.9 and spring boot 3.5.6 and java 25

you have to put the “vaadin-spring-boot-starter” dependency on the top of your dependenies in your pom.xm. this will fix the java 25 problem.

[INFO] --- dependency:3.8.1:tree (default-cli) @ dh64web ---
[INFO] com.dh64web:dh64web:jar:0.0.1-SNAPSHOT
[INFO] \- com.vaadin:vaadin-spring-boot-starter:jar:24.9.0:compile
[INFO]    \- com.vaadin:vaadin-spring:jar:24.9.0:compile
[INFO]       \- com.vaadin:flow-server:jar:24.9.0:compile
[INFO]          \- org.ow2.asm:asm:jar:9.8:compile

image

maven is not able to resolve the conflict with the version correct depending on the order of dependencies. would it be possible to solve this problem in a cleaner way than letting the user pay attention to the order of dependencies? could the required version for “asm” be specified in the vaadin-bom?

NO. do not even think about it for a second.