Cant find .../component/shared/SelectionPreservationHandler for CheckboxGroup in Flow 24.4.4

Hi.

I want to use CheckboxGroup like based on this example.

But each time i try to run my apps, i get this error message:

java.lang.NoClassDefFoundError: com/vaadin/flow/component/shared/SelectionPreservationHandler

I create my apps with start.vaadin.com.

I use vaadin 24.4.4 + springboot 3.2.7

I search and find that SelectionPreservationHandler is in package vaadin-flow-components-shared which is available in mvn with its version is 23.0.16.

Should i add this artifact on my project when it has different version than vaadin-core 24.4.4 vs 23.0.16 ?

or should i do something else?

thanks in advance.
sLawalata

That class is really new… so it isn’t available in versions before 24.4 - my first guess would be: you are using an add-on which has an old version of the shared dependency. Did you try maven dependency tree to check if your shared dependency is also 24.4.x?

Edit: the shared package is named “vaadin-flow-components-base”

I accidently added this on my pom.xml

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-radio-button-flow</artifactId>
            <version>24.3.13</version>
        </dependency>

I found it after comparing my project pom.xml with a new pom.xml from start.vaadin.com project. I removed it and it runs fine at this moment :slight_smile:

Thanks @knoobie for your hints.

many thanks