Quick revision
The short answer
The cleanest path is to get a Jakarta release from the vendor. If that is not possible, we can wrap the library behind our own interface so it can be replaced later, convert its bytecode from javax to jakarta with a tool such as the Eclipse Transformer, with thorough testing and a plan for support, or keep the service on Boot 2.7 deliberately. Staying on 2.7 means no open-source support or security fixes unless we buy commercial support, so the risk must be recorded explicitly, and every exception needs an owner and a deadline.
What to remember
In this answer, we saw that a javax-only library cannot run on Boot 3 because the container speaks only the Jakarta API. The options are, in order: a vendor Jakarta release, which is cleanest; wrapping the library behind our own interface, which helps every other option; transforming the bytecode with the Eclipse Transformer, with testing and ownership; isolating the vendor part in a small 2.7 service; or staying on 2.7, which means no open-source security fixes without commercial support. Whatever we choose, the exception needs an explicit risk record, an owner and a deadline.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
The cleanest path is to get a Jakarta release from the vendor. If that is not possible, we can wrap the library behind our own interface so it can be replaced later, convert its bytecode from javax to jakarta with a tool such as the Eclipse Transformer, with thorough testing and a plan for support, or keep the service on Boot 2.7 deliberately. Staying on 2.7 means no open-source support or security fixes unless we buy commercial support, so the risk must be recorded explicitly, and every exception needs an owner and a deadline.
Why this question is asked
Platform migrations always leave a few services behind, and the reason is often not our code but a dependency we do not control. A vendor library compiled against javax.servlet cannot run in a Spring Boot 3 application, because the javax classes are gone and the container only knows jakarta. Interviewers ask this scenario to see whether we can lay out the options with their real costs and manage the exception so it does not quietly become permanent. In this answer, we will see why the library blocks the upgrade, go through the options from best to least good, discuss the risk of staying on 2.7, and finish with how to govern the exception.
1Why the Library Blocks the Upgrade
Spring Boot 3 is built on Spring Framework 6 and Jakarta EE 9 and later, where the servlet API lives in jakarta.servlet. The vendor library's classes refer to javax.servlet.Filter, javax.servlet.http.HttpServletRequest and so on. In a Boot 3 application those classes do not exist on the classpath. Even if we added the old javax servlet jar, the embedded Tomcat 10.1 would never call a javax filter, because a javax.servlet.Filter is a different type from a jakarta.servlet.Filter. So the library fails at runtime, typically with NoClassDefFoundError for a javax.servlet class, the first time it is loaded.
That is why this cannot be fixed by configuration. Either the library changes, or our service does not upgrade.
2Option 1: Ask the Vendor for a Jakarta Release
Most vendors have released Jakarta versions by now, since the whole ecosystem moved with Boot 3 and Jakarta EE 10. The first step is to ask, with a concrete date, and to check whether a newer major version already supports Jakarta under a different artifact name, which is common. This is the cleanest path because the vendor tests and supports the result. Its weakness is that we do not control the timeline, so we pursue it in parallel with the other options rather than waiting for it.
3Option 2: Wrap the Library Behind an Interface
Whatever else we do, isolating the library makes every later step cheaper. We define our own interface for what we use the library for, and put the vendor-specific code in one adapter class.
Notice that if the library's dependency on javax.servlet is only in parts we do not use, for example a servlet filter it offers but our code never registers, the wrapper may even let the rest of the library work under Boot 3, as long as the javax classes are never loaded. That needs careful testing, but it happens more often than people expect. And if we later replace the vendor, only the adapter changes.
4Option 3: Transform the Bytecode
The Eclipse Transformer is a tool that rewrites compiled classes and resources, changing javax references to their jakarta equivalents. We run it on the vendor jar during the build and depend on the transformed jar instead.
| Option | Effort | Main risk |
|---|---|---|
| Vendor Jakarta release | low for us | timeline outside our control |
| Wrap behind an interface | small | none; it supports the other options |
| Eclipse Transformer | medium | unsupported jar, reflection gaps, re-run per release |
| Separate small service on 2.7 | medium | still unsupported, but isolated |
| Stay on Boot 2.7 | none now | no security fixes without commercial support |
This works for many libraries because the javax to jakarta change was a pure rename. The costs are real, though. The vendor will not support the transformed jar, so we own any problem it causes. Reflection with class names built from strings may be missed. And every new vendor release must be transformed again and retested. So this is an acceptable bridge when we have good integration tests for the library's behaviour, and when someone owns the transformation in the build.
5Option 4: Stay on Boot 2.7, With the Risk Recorded
Keeping the service on Spring Boot 2.7 is the option that costs nothing today. But open-source support for Boot 2.7, the last 2.x line, ended in 2023, and the Spring Framework 5.3 line under it is no longer maintained in open source either. So new vulnerabilities in Spring, Tomcat 9 integration or other managed dependencies will not get open-source fixes for this service. Commercial support from the vendor behind Spring extends the fixes for a fee, which can be a sensible bridge.
If we stay, we record that decision explicitly in the risk register: the service, the unsupported components, the exposure, for example whether it faces the internet, the compensating controls such as network isolation, and the date we will review it. A variation is to move only the vendor-dependent part into a small separate service that stays on 2.7, so the rest of the codebase moves to Boot 3 and the unsupported surface becomes as small as possible.
6Governing the Exception
Temporary exceptions tend to become permanent, because once the platform moves on, nobody's quarterly goals include the one service left behind. So the exception gets an owner, a named person or team, and a deadline, such as two quarters, with a check-in each month on the vendor's progress. The wrapper interface is built immediately regardless, so that when the deadline comes we can transform, replace or extract with little work. And if the deadline passes without a vendor release, the decision moves automatically to the next option instead of the exception being renewed by default.
7Follow-up questions
Can we run javax and jakarta servlet code side by side in one application?
Not in one servlet container, because the container implements only one of the two APIs. A filter written against javax.servlet is simply a different type that Tomcat 10.1 never calls. Side by side only works in separate processes, which is why extracting the vendor part into its own small service is an option.
How would you test a transformed library before trusting it?
Write integration tests around the features we actually use, run them against both the original jar on Boot 2.7 and the transformed jar on Boot 3, and compare results. Also search the jar for string references to javax class names, which suggest reflection the transformer might not catch.
Who should decide whether to buy commercial support?
The service owner proposes it with the risk assessment, and whoever owns the budget and the risk register, usually an engineering manager or a security lead, decides. The point is that someone accepts the risk explicitly, rather than the service drifting unsupported.
8Conclusion
In this answer, we saw that a javax-only library cannot run on Boot 3 because the container speaks only the Jakarta API. The options are, in order: a vendor Jakarta release, which is cleanest; wrapping the library behind our own interface, which helps every other option; transforming the bytecode with the Eclipse Transformer, with testing and ownership; isolating the vendor part in a small 2.7 service; or staying on 2.7, which means no open-source security fixes without commercial support. Whatever we choose, the exception needs an explicit risk record, an owner and a deadline.
Open with
The library cannot run on Boot 3 at all, because Boot 3 uses the jakarta servlet API and the container never calls javax types, so this is a choice between changing the library and not upgrading.
Then, if they want more
First, I would ask the vendor for a Jakarta release with a date, and check whether a newer version already has one under a different artifact, which is common. In parallel, I would wrap the library behind our own interface so only one adapter class knows about it.
That makes every other option cheaper, and sometimes, if the javax dependency is only in parts we never load, the rest of the library even works on Boot 3 after testing. If the vendor cannot deliver, the Eclipse Transformer can rewrite the jar's bytecode from javax to jakarta.
That often works because it was a pure rename, but the vendor will not support it, reflection can be missed, and we have to redo it for every release, so it needs good integration tests and an owner.
If we decide to stay on 2.7, I would be explicit that open-source support ended in 2023, so there are no security fixes unless we buy commercial support, and record that in the risk register with the exposure and compensating controls, or shrink it by moving just the vendor part into a small separate service.
And whatever we choose, the exception gets an owner and a deadline, because temporary exceptions otherwise become permanent.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Spring Boot 3, Jakarta EE 10, Jakarta EE 9, Spring Boot 2.7
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Framework reference, Core technologies
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 "You must keep one Spring Boot 2.7 service running on a vendor library that only ships...": https://scrivio-interview-library.netlify.app/spring-boot/spring-framework-evolution/ec2ac4aff9/