Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Why did Spring largely displace EJB for enterprise Java, and what does Jakarta EE still offer today?

Early EJB forced developers to write extra interfaces and XML deployment descriptors and to deploy into a full application server just to run a test, which made development slow. Spring offered dependency injection and declarative transactions on plain Java objects that could be tested without a container, and Spring Boot later removed most configuration and embedded the server. Jakarta EE has since become much simpler with CDI and annotations, and it still defines vendor-neutral standards that Spring itself builds on, such as Servlet, JPA and Bean Validation, while Jakarta EE runtimes and MicroProfile remain a good fit where standards and vendor support matter.

Why this question is asked

At a senior level, this question is less about history and more about judgement. Understanding why one technology replaced another tells us what developers actually value, and that helps when we make the next platform decision. Interviewers also want to hear that we do not treat Jakarta EE as dead, because Spring applications use Jakarta EE specifications every day. In this answer, we will look at what made early EJB painful, what Spring changed, what Spring Boot added, how Jakarta EE itself evolved, and where Jakarta EE runtimes are still the better choice.

1What Early EJB Asked of Developers

EJB (Enterprise JavaBeans) was the part of J2EE, the enterprise Java platform of the early 2000s, that hosted business logic. In EJB 2.x, a single business service needed a remote interface, a home interface used to create the bean, the bean class itself and an entry in an XML deployment descriptor (ejb-jar.xml) that described transactions and security. Entity beans, the persistence model of the time, were even heavier and performed poorly.

The bigger cost was the development loop. An EJB only worked inside an application server, so to test one method we packaged an EAR file, deployed it to WebLogic or WebSphere, waited for the server to start and then called the bean. A change and retest cycle could take minutes. Unit tests in the modern sense were close to impossible, because the business class depended on the container for transactions, lookups and lifecycle.

2What Spring Changed

Spring, which grew out of the code in Rod Johnson's 2002 book on J2EE design and reached version 1.0 in 2004, made a simple but powerful promise: our business classes are plain Java objects (POJOs), and the framework adds the enterprise services from the outside. Dependency injection, where the framework gives each object the objects it needs instead of the object looking them up, meant a service could receive a fake repository in a test. Declarative transactions, the same idea EJB had, were applied through proxies, wrapper objects created at runtime, so @Transactional worked without any special interfaces.

So the same class could run inside Tomcat in production and inside a plain JUnit test on a laptop in milliseconds. That was the decisive difference. Teams could adopt Spring one class at a time, run it on a cheap servlet container instead of an expensive server, and test it quickly.

Early EJB compared with Spring
ConcernEJB 2.xSpring
Business classBean class plus home and remote interfacesPlain Java class
Configurationejb-jar.xml and vendor descriptorsXML at first, then annotations
TransactionsContainer-managed, declared in XML@Transactional through a proxy
TestingDeploy to a server firstPlain unit test, or a light context
RuntimeFull application serverAny servlet container

3What Spring Boot Added

Spring itself still needed a lot of configuration, and by 2012 setting up a project meant choosing dozens of library versions and writing configuration for each. Spring Boot, released in 2014, removed most of that work. Starters bring a tested set of dependencies, auto-configuration creates beans such as a DataSource from a few properties, and the web server is embedded, so the application is one jar we run with java -jar.

Notice how that inverted the old model. With EJB, the server was installed first and applications were deployed into it. With Spring Boot, the application contains its server. That fits containers and cloud platforms naturally, where each service is a separate process with its own image, and it is a big reason why most new enterprise Java services over the last decade have been Spring Boot.

4How Jakarta EE Evolved

The standards did not stand still. Java EE 5 and 6 brought annotations, EJB 3 removed the home interfaces, JPA replaced entity beans, and CDI (Contexts and Dependency Injection) gave the platform its own dependency injection model. When Oracle moved Java EE to the Eclipse Foundation, it became Jakarta EE and the packages moved from javax to jakarta. Jakarta EE 10 added the Core Profile for small services, and Jakarta EE 11 continues on current Java.

But there is a catch that many people miss: Spring applications use Jakarta EE every day. Spring MVC runs on the Jakarta Servlet API, Spring Data JPA uses Jakarta Persistence and Hibernate implements it, validation uses Jakarta Bean Validation, and the @PreDestroy and @Resource annotations come from Jakarta Annotations. Spring Framework 6 and 7 moved to the jakarta namespace for exactly this reason. So Spring displaced EJB as a programming model, but it did not displace the standards.

Step throughWhere Jakarta EE sits inside a Spring Boot service
  1. Our controllers and servicesSpring programming model
  2. Spring MVC, Spring Data, Spring SecuritySpring Framework 6 or 7
  3. Jakarta Servlet, Persistence, ValidationVendor-neutral Jakarta EE APIs
  4. Tomcat, Hibernate, Hibernate ValidatorImplementations of those APIs
  5. JVMJava 17 or later, Java 25 LTS current

5 layers, from the top down. Step through them one at a time.

5Where Jakarta EE Runtimes Still Make Sense

Jakarta EE runtimes such as WildFly, Open Liberty, Payara and GlassFish, and MicroProfile runtimes such as Quarkus and Helidon, remain relevant. Some organisations value a specification with several compatible implementations, because they can change vendor without rewriting code. Some need commercial support with long support lifetimes, for example in banking or government. And large existing portfolios written to Java EE standards can often move to a supported open source runtime much more cheaply than to Spring.

So as a leader I would not frame this as one winner. Spring Boot is the default for most new services because of its ecosystem and hiring pool, while Jakarta EE gives the shared APIs everyone uses and runtimes that are a sound choice when standards, vendor neutrality or an existing codebase matter more.

6Follow-up questions

Is EJB still used today?

Yes, in many long-lived systems, and EJB 3 Lite is still part of Jakarta EE. But new code on Jakarta EE runtimes usually uses CDI beans with @Transactional from Jakarta Transactions instead, because CDI is simpler and EJB features such as remote interfaces are rarely needed.

Is Spring itself a Jakarta EE implementation?

No. Spring is not certified as a Jakarta EE platform. It uses selected Jakarta EE specifications through implementations such as Tomcat and Hibernate, and it provides its own programming model for the rest, such as Spring's dependency injection instead of CDI.

What lesson does this history teach for future platform choices?

Developers adopt what shortens the feedback loop and reduces ceremony, even if the standard is technically capable. When we choose a platform, we should weigh developer productivity, testability and ecosystem as heavily as features and vendor promises.

7Conclusion

In this answer, we saw that early EJB lost ground because it demanded extra interfaces, XML descriptors and a full application server even for a simple test. Spring gave the same enterprise services to plain objects that could be tested anywhere, and Spring Boot removed configuration and embedded the server. Jakarta EE has become much simpler, and its APIs such as Servlet, JPA and Bean Validation sit underneath every Spring Boot service, while Jakarta EE and MicroProfile runtimes remain a good choice where standards and vendor support matter most.

What to say in the interviewAbout 80 seconds aloud

Open with

Early EJB was heavy for developers. A single service needed a home interface, a remote interface, the bean class and XML descriptors, and it only ran inside an application server, so testing one method meant packaging and deploying an EAR and waiting minutes.

Then, if they want more

Spring changed that by putting dependency injection and declarative transactions on plain Java objects. The same class could run in Tomcat in production and in a plain unit test in milliseconds, and teams could adopt it gradually on cheap servlet containers.

Spring Boot then removed most configuration with starters and auto-configuration and embedded the server, which fits containers very well, so it became the default for new services. But I would not say Jakarta EE lost.

It simplified a lot, with annotations, JPA and CDI, and Spring applications use its standards every day: the Servlet API under Spring MVC, Jakarta Persistence under Spring Data JPA, Bean Validation for validation. That is why Spring 6 moved to the jakarta namespace.

Jakarta EE runtimes like Open Liberty or WildFly, and MicroProfile runtimes like Quarkus, still make sense when an organisation values vendor-neutral standards, long commercial support, or already has a large Java EE codebase that can move to another runtime cheaply.

About this answer

Last updated
12 November 2026
Versions it names
Jakarta EE 10, Jakarta EE 11, Spring Framework 6
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
Jakarta EE specifications
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 "Why did Spring largely displace EJB for enterprise Java, and what does Jakarta EE still...": https://scrivio-interview-library.netlify.app/java/jakarta-ee-platform/3ad547848c/