Scrivio Interview library
ScenarioIntermediate7 min read · updated 12 November 2026

A team upgrades an old Dropwizard 1.x service to the current major version. What changes and risks would you plan for?

I would plan it as a series of steps, one major version at a time, because each Dropwizard major moved to newer Jetty, Jersey, Jackson and validation versions, and the 4.x line moved from the javax to the jakarta namespace (jakarta.ws.rs, jakarta.validation). Along the way the service moves to a supported Java version and the Dropwizard BOM, removed or renamed APIs in bundles, filters and custom Jackson modules are replaced, and third-party bundles are upgraded. Contract and integration tests guard the JSON output and error formats, and a canary release with admin metrics confirms the result before full rollout.

Why this question is asked

Dropwizard 1.x dates from 2016 to 2019. A service still on it typically runs Java 8, Jetty 9.4 and Jersey 2.25, all long out of support, and security scanners flag its dependencies constantly. Upgrading is clearly necessary, but jumping straight to the newest version changes almost every library under the service at once. Interviewers ask this scenario to see whether we can plan a multi-step platform upgrade and anticipate where it really breaks. In this answer, we will look at what changed between majors, plan the sequence, go through the code changes, protect the HTTP contract with tests, and roll out with a canary.

1What Changed Between the Major Versions

Dropwizard is a curated set of libraries, so a major version is mostly a coordinated upgrade of those libraries. Going from 1.x to 2.x brought newer Jersey and Jackson releases, Hibernate Validator 6 and JUnit 5 support in dropwizard-testing. Version 3.0 required Java 11 and moved to Jetty 10 while keeping the javax packages. Version 4.0 moved to Jetty 11 and the Jakarta EE namespace, so javax.ws.rs became jakarta.ws.rs and javax.validation became jakarta.validation. Later releases continue with newer Jetty and Jakarta versions and Java baselines. The exact details are in each release's upgrade notes, which we read for every step rather than relying on memory.

Dropwizard major lines, simplified
LineMain platform changesCode impact
1.xJetty 9.4, Jersey 2.25, Java 8starting point
2.xnewer Jersey, Jackson, Hibernate Validator 6testing API, some renamed classes
3.xJava 11, Jetty 10, still javaxservlet and Jetty API changes
4.xJetty 11, Jakarta namespacejavax -> jakarta imports everywhere
laternewer Jetty and Jakarta, newer Javacheck the current upgrade notes
One major at a time keeps each step's failures understandable; verify each line in its release notes.

Notice that the namespace change is the largest single code change, and it arrives in one step. Separating it from the others makes failures much easier to diagnose.

2Planning the Sequence

We upgrade one major version at a time: 1.x to the last 2.x, then 3.x, then 4.x, and then the current line. Each step is a working, deployable state, so if something goes wrong we know which step caused it and can stop there. Before starting, we move the service to a supported Java version that the target versions accept, Java 17 or 21 being sensible choices, and we switch the build to import the Dropwizard BOM, dropwizard-dependencies, so that all Dropwizard modules and their libraries move together instead of being pinned one by one.

XML
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-dependencies</artifactId>
<version>${dropwizard.version}</version> <!-- change only this per step -->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- remove hand-pinned Jackson, Jersey and Jetty versions: they fight the BOM -->
Step throughUpgrade plan for one service
  1. Add tests for the HTTP contractbefore changing anything
  2. Move to a supported Javaand import the Dropwizard BOM
  3. Upgrade one major versionread the upgrade notes
  4. Build and tests green?
    YesCanary deploy, watch metricsNoFix APIs, bundles, modules
  5. More majors to go?
    YesNext major versionNoFull rollout

5 steps in order. Play them, or step through them one at a time.

Every major is its own deployable step.

Removing hand-pinned versions matters. Old services often override Jackson or Jetty to fix a vulnerability years ago; left in place, those overrides produce mixed library versions that fail at runtime with NoSuchMethodError. Each step's goal is a clean dependency tree with versions from the BOM only.

3Code Changes to Expect

Most changes fall into a few groups. Removed or renamed APIs in our own code: custom bundles implement ConfiguredBundle with slightly different method signatures, filters and exception mappers may need changes, and Jetty APIs used directly, such as handlers or servlet filters, change between Jetty 9.4, 10 and 11. Custom Jackson modules, serializers and deserializers may need updates when Jackson changes its defaults or deprecates methods. Tests move from JUnit 4 rules such as DropwizardAppRule to JUnit 5 extensions such as DropwizardAppExtension.

Third-party bundles are often the real blocker. A service that uses a community bundle for authentication or Swagger needs a release of that bundle for each Dropwizard version, and some were abandoned. For each one, we check whether a compatible version exists, and if not, we replace it with Dropwizard's own modules or a small piece of our own code. The jakarta step itself is mechanical and is best done by a tool, for example an OpenRewrite recipe for the javax to jakarta migration, rather than by search and replace, which misses string references and configuration files.

Java
// Before (Dropwizard 3.x and older)
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.validation.constraints.NotNull;
// After (Dropwizard 4.x and later)
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.validation.constraints.NotNull;
// Every library touching JAX-RS or validation must also be on its jakarta version

The last comment is the trap: our own code may compile, but a library still compiled against javax.ws.rs will fail at runtime because the classes it expects are not there. That is why the dependency tree must be checked for remaining javax artefacts at the jakarta step.

4Protecting the HTTP Contract

The riskiest changes are those that compile and still change behaviour. Newer Jackson versions can change how dates, null fields or unknown properties are handled if our ObjectMapper relied on defaults. Newer Jersey versions can change the body of validation errors, the status code for some failures, or how a missing content type is treated. Clients depend on those details even when nobody documented them.

So before the first upgrade step we write tests that capture the contract as it is: integration tests with DropwizardAppExtension that call each endpoint and compare the full JSON response, including error responses for invalid input, unknown routes and server errors, with recorded examples. If consumers exist, contract tests from their side are even better. Then every step must keep those tests green, and any difference is either fixed in configuration, for example by setting the Jackson feature explicitly, or deliberately accepted and announced.

5Rolling Out With a Canary

Tests cannot cover every client or every traffic pattern, so the last safeguard is the rollout. We deploy the upgraded version to one instance, or a small percentage of traffic, next to the old version, and compare the two through the admin metrics: response status rates per endpoint, latency percentiles, Jetty thread pool usage and JVM memory and garbage collection. Dropwizard's metrics make this comparison easy, because both versions expose the same names.

If the canary shows a rise in 4xx or 5xx responses, more latency or different memory behaviour, we roll back and investigate before going further. Only after the canary has handled a normal day of traffic do we roll out fully, and then we start the next major step from that stable base.

6Follow-up questions

Why not jump straight to the latest version?

Because every library changes at once, and when something fails we cannot tell which change caused it. Upgrade notes are written per major, assuming the previous one, and deprecation warnings in an intermediate version tell us what will be removed next. One step at a time is slower per step but faster overall.

How long should an upgrade like this take?

For a small service with good tests, a few days per major; for a large one with custom bundles and Jetty code, several weeks. The time is dominated by third-party bundles and contract differences, which is why we inventory both at the start.

Is this the moment to migrate to Spring Boot instead?

It may be, if the service is actively developed and the company standard is Spring Boot. But a framework migration is a much bigger change than an upgrade, so for a service that changes rarely, upgrading Dropwizard is the cheaper, safer way to get back onto supported versions.

7Conclusion

In this answer, we planned an upgrade from Dropwizard 1.x to the current version. Each major moved to newer Jetty, Jersey and Jackson, and the 4.x line moved to the jakarta namespace, so we go one major at a time on a supported Java with the Dropwizard BOM, replace removed APIs, custom Jackson modules and third-party bundles, protect JSON and error formats with contract and integration tests written before the first step, and roll out each step with a canary watched through the admin metrics.

What to say in the interviewAbout 80 seconds aloud

Open with

I would plan it as several steps rather than one jump. Each Dropwizard major is essentially a coordinated upgrade of Jetty, Jersey, Jackson and Hibernate Validator, and in the 4.x line the namespace moved from javax to jakarta, so jakarta.ws.rs and jakarta.validation.

Then, if they want more

Before touching versions, I would write integration tests with DropwizardAppExtension that capture the current HTTP contract, including error responses, because Jackson and Jersey upgrades can change JSON and error formats without any compile error.

Then I move the service to a supported Java, 17 or 21, import the dropwizard-dependencies BOM and remove hand-pinned Jackson or Jetty versions that would mix libraries. Then I go one major at a time, reading the upgrade notes for each: renamed APIs in bundles and filters, Jetty API changes, custom Jackson modules, JUnit 4 rules to JUnit 5 extensions.

Third-party bundles are often the blocker, so I inventory them early and replace abandoned ones. For the jakarta step I would use an OpenRewrite recipe and then check the dependency tree for anything still on javax.

Every step gets a canary deployment where I compare status codes, latency and thread pool metrics from the admin port with the old version before rolling out fully.

About this answer

Last updated
12 November 2026
Versions it names
JUnit 5, JUnit 4, Java 11, Java 17
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "A team upgrades an old Dropwizard 1.x service to the current major version. What changes...": https://scrivio-interview-library.netlify.app/java/dropwizard/349d202422/