Skip to content

Fix SerializationTest failure with Vaadin 25.1.x #117

@javier-godoy

Description

@javier-godoy

Problem

SerializationTest fails with Vaadin 25.1.0-rc2:

java.lang.NoClassDefFoundError: jakarta/servlet/http/HttpSessionBindingListener

Root cause

The test was relying on jakarta.servlet:jakarta.servlet-api being provided transitively through the testbench dependency chain. That chain changed between Vaadin versions:

Vaadin vaadin-testbench-core includes vaadin-testbench-unit
25.0.x 10.0.3 ✅ → transitively brings jakarta.servlet-api:6.1.0
25.1.0-rc2 10.1.0-rc1 ❌ removed

In vaadin-testbench-core:10.0.3, the chain was: vaadin-testbench-unitvaadin-testbench-unit-sharedjakarta.servlet:jakarta.servlet-api:6.1.0:test. In 10.1.0-rc1, vaadin-testbench-unit was dropped from vaadin-testbench-core.

Fix

Add an explicit test dependency to the v25 profile in pom.xml. flow-server:25.1.0-rc1 declares jakarta.servlet:jakarta.servlet-api:6.1.0 as provided, so that is the correct version:

<dependency>
    <groupId>jakarta.servlet</groupId>
    <artifactId>jakarta.servlet-api</artifactId>
    <version>6.1.0</version>
    <scope>test</scope>
</dependency>

Verified locally: mvn test -Pv25 passes with Vaadin 25.1.0-rc2 after adding this dependency to the v25 profile.

Reported from ecosystem build issue: mstahv/vaadin-ecosystem-build#108

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Inbox (needs triage)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions