Quick revision
The short answer
Spring Boot 3 is built on Jakarta EE 9 and later APIs, so imports such as javax.persistence, javax.servlet and javax.validation become jakarta.persistence, jakarta.servlet and jakarta.validation. Every library that touches these APIs needs a Jakarta-compatible version, or it fails at compile time or at runtime. Beyond the namespace, stateless EJBs usually become Spring beans with @Service and @Transactional, JNDI datasources and other server-managed resources become Spring Boot configuration properties, and OpenRewrite recipes can automate much of the work, though the result must be reviewed.
What to remember
In this answer, we saw that moving a Java EE 8 application to Spring Boot 3 means switching Java EE packages from javax to jakarta while JDK packages such as javax.sql stay, upgrading every library to a Jakarta-compatible version, converting stateless EJBs into Spring beans with @Service and @Transactional while checking default transaction and rollback behaviour, replacing JNDI resources with Spring Boot properties, and using OpenRewrite to automate much of the change with a careful review.
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.
Spring Boot 3 is built on Jakarta EE 9 and later APIs, so imports such as javax.persistence, javax.servlet and javax.validation become jakarta.persistence, jakarta.servlet and jakarta.validation. Every library that touches these APIs needs a Jakarta-compatible version, or it fails at compile time or at runtime. Beyond the namespace, stateless EJBs usually become Spring beans with @Service and @Transactional, JNDI datasources and other server-managed resources become Spring Boot configuration properties, and OpenRewrite recipes can automate much of the work, though the result must be reviewed.
Why this question is asked
Many companies still run Java EE 8 applications on application servers, and moving them to Spring Boot 3 is a common modernisation task. The javax to jakarta change sounds like a find-and-replace, and much of it is, but it ripples through every dependency, and the move from a server-managed model to Spring Boot changes how transactions, resources and configuration work. Interviewers ask this to see whether we understand both parts. In this answer, we will recap why the namespace changed, see what changes in code, deal with libraries, convert EJBs and JNDI resources, and look at automating it with OpenRewrite.
1A Quick Recap: Why javax Became jakarta
Java EE, the enterprise Java standard, was developed by Oracle. In 2017 Oracle moved it to the Eclipse Foundation, where it was renamed Jakarta EE. Oracle kept the rights to the javax namespace, so the Eclipse Foundation could not evolve APIs under javax. Jakarta EE 8 was the same as Java EE 8, still using javax. Jakarta EE 9, released in 2020, made a single big change: every API package moved from javax.* to jakarta.*, with almost no other differences.
Spring Framework 6 and Spring Boot 3 moved to Jakarta EE 9 as their baseline, and current versions build on Jakarta EE 10, with Spring Boot 4 and Spring Framework 7 moving to Jakarta EE 11. They also require Java 17 or later. So a Java EE 8 application moving to Spring Boot 3 must switch namespaces, and there is no way to mix: a javax.servlet.Filter is simply a different type from jakarta.servlet.Filter.
2What Changes in the Code
Most changes are imports. Note that not everything under javax moves: packages that are part of the JDK itself, such as javax.sql.DataSource, javax.crypto and javax.net, stay as they are, because they belong to Java SE, not Java EE.
| Java EE 8 (javax) | Spring Boot 3 (jakarta) | Notes |
|---|---|---|
javax.persistence | jakarta.persistence | Hibernate 6 or later |
javax.servlet | jakarta.servlet | Tomcat 10.1 or later |
javax.validation | jakarta.validation | Hibernate Validator 8 or later |
javax.transaction | jakarta.transaction | @Transactional from Jakarta |
javax.annotation (PostConstruct) | jakarta.annotation | lifecycle annotations |
javax.sql, javax.crypto | unchanged | part of the JDK, not Java EE |
Notice the last comment. Strings in configuration files, property names and service loader files also name these packages, and the compiler will not find them. A missed one fails only at runtime, for example as a provider that silently does not load.
3Every Library Must Be Jakarta-Compatible
The harder part is dependencies. Any library that uses Java EE types in its API must have a version built for jakarta. If an old library still uses javax.servlet.Filter, our Spring Boot 3 application cannot register it: compilation fails if we reference its types, or, worse, the application starts and fails at runtime with a NoClassDefFoundError or ClassNotFoundException for a javax class that no longer exists on the classpath.
So we inventory every dependency: the persistence provider (Hibernate 6 or later), validation (Hibernate Validator 8 or later), JSON-B or JAX-RS implementations if still used, SOAP libraries, PDF and reporting tools, security libraries and internal shared libraries. For each, we find the Jakarta version. Internal libraries are often the slowest part, because their owning teams must release jakarta versions first. For an old third-party library with no Jakarta version, the options are replacing it, or as a last resort transforming its bytecode with a tool such as the Eclipse Transformer, which needs careful testing.
4From EJBs to Spring Beans
In Java EE, business logic often lives in stateless session beans, EJBs, whose transactions are managed by the application server. In Spring Boot, the equivalent is a plain Spring bean with @Service, and transactions come from @Transactional, which Spring applies through a proxy.
Notice two behaviour differences to check. An EJB method is transactional by default; a Spring bean method is only transactional with @Transactional, so forgetting it silently removes the transaction. And rollback rules differ: with EJBs, application exceptions do not roll back by default while system exceptions do; Spring rolls back on unchecked exceptions and errors, and not on checked exceptions unless configured with rollbackFor. Also, Spring's proxy does not apply to calls a bean makes to its own methods, so internal calls between transactional methods need care.
5From JNDI Resources to Configuration Properties
In Java EE, the application server owns resources: a datasource is configured in the server and looked up by a JNDI name such as java:jboss/datasources/OrdersDS, and JMS queues and mail sessions work the same way. Spring Boot creates these itself from configuration properties, so the application carries its configuration and can run as a plain jar.
Notice that secrets come from the environment or a secret store, not from the file. Server-level settings, such as pool sizes, timeouts and security realms, must be found in the old server configuration and carried over deliberately, because they are easy to lose in the move.
6Automating With OpenRewrite, Then Reviewing
OpenRewrite is an open-source tool that applies automated refactorings, called recipes, to source code and build files. Its recipes for migrating to Spring Boot 3 and to Jakarta EE change imports, property names, dependency versions and some deprecated APIs across the whole codebase in one run, through the Maven or Gradle plugin. This can save weeks on a large application.
But we review the result like any large change. Recipes cannot convert EJB semantics, server resources or custom security realms, and they may miss strings in unusual files. The typical approach is to run the recipes on a branch, build and run the full test suite, fix what remains by hand, and test transactions, security and startup carefully. Check the current recipe names for your target version, since they change between OpenRewrite releases.
- Inventory dependencies and their Jakarta versionsincluding internal libraries
- Upgrade to Java 17 or laterSpring Boot 3 baseline
- Run OpenRewrite recipes on a branchimports, properties, versions
- Convert EJBs and JNDI resources by hand
@Service,@Transactional, properties - Build and run the full test suite
- All tests and startup checks pass?YesReview the diff, then releaseNoFix remaining javax usages and libraries
6 steps in order. Play them, or step through them one at a time.
7Follow-up questions
Can we move to Spring Boot 2 first and then to 3?
Yes, and for large applications it is often wise. Spring Boot 2.7 still uses javax, so we can first replace the application server model, EJBs and JNDI with Spring Boot, and then do the javax to jakarta switch as a separate step. Each step is smaller and easier to test.
What error shows that a library still uses javax?
Typically a NoClassDefFoundError or ClassNotFoundException naming a javax class, such as javax/servlet/Filter, at startup or when the library is first used, or compile errors if our code passes jakarta types to it. Dependency analysis before migrating finds most of these in advance.
Does Spring Boot 3 still support deploying to an application server?
Spring Boot can build a WAR for deployment to a Jakarta EE 9 or later compatible server, such as Tomcat 10.1, but the server must be jakarta-based. Most teams use the embedded server and a plain jar, which removes the dependency on a separately managed application server.
8Conclusion
In this answer, we saw that moving a Java EE 8 application to Spring Boot 3 means switching Java EE packages from javax to jakarta while JDK packages such as javax.sql stay, upgrading every library to a Jakarta-compatible version, converting stateless EJBs into Spring beans with @Service and @Transactional while checking default transaction and rollback behaviour, replacing JNDI resources with Spring Boot properties, and using OpenRewrite to automate much of the change with a careful review.
Open with
The big change is the namespace. Java EE moved to the Eclipse Foundation as Jakarta EE, and from Jakarta EE 9 all the APIs moved from javax to jakarta.
Then, if they want more
Spring Boot 3 is built on Jakarta EE 9 and later, and needs Java 17, so javax.persistence, javax.servlet, javax.validation and so on become jakarta imports. JDK packages like javax.sql and javax.crypto stay unchanged. It is not only imports: property names in persistence.xml, service loader files and XML can name javax too.
The harder part is libraries: every library that uses those APIs needs a Jakarta version, like Hibernate 6 and Hibernate Validator 8, otherwise we get compile errors or NoClassDefFoundError for javax classes at runtime, and internal shared libraries are often the slowest.
Then the programming model changes: stateless EJBs become Spring beans with @Service and @Transactional, and I would check the differences, since EJB methods are transactional by default and the rollback rules differ. JNDI datasources and other server resources become spring.datasource properties with secrets from the environment.
For the mechanical part, I would run the OpenRewrite Spring Boot 3 and Jakarta recipes on a branch, then review the diff and run the full test suite. For a big application, I might go to Spring Boot 2.7 first and do the namespace switch separately.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Spring Boot 3, Jakarta EE 9, Hibernate 6, Jakarta EE 10
- 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 "What changes when moving a Java EE 8 application to Spring Boot 3, especially around the...": https://scrivio-interview-library.netlify.app/architecture/modernization/f95cab6643/