Scrivio Interview library
ScenarioIntermediate7 min read · updated 12 November 2026

You are leading a migration of a large Java EE application running on WebLogic with EJBs, JMS, EJB timers and JAX-RS to Spring Boot on Kubernetes. How do you plan it?

I would start with an inventory of every application server feature the code relies on (container-managed transactions, JMS, EJB timers, security realms, JNDI lookups and clustering) and map each one to its Spring equivalent. Then I would migrate in small steps protected by characterisation tests and a parallel run, paying special attention to transaction behaviour, and add the things Kubernetes expects: external configuration, health probes and logs on standard output.

Why this question is asked

A large Java EE application on WebLogic leans on the application server for far more than serving HTTP: transactions, JMS delivery, timers, security and JNDI resources. After the move, every one of those jobs must be done by something else, and the bugs come from the jobs nobody noticed. Interviewers ask this to see whether a candidate plans from facts. In this answer, we will recap what the server was doing, build an inventory, map each feature to Spring, look closely at transactions, decide what to do with JAX-RS, and finish with a step-by-step migration and the container concerns Kubernetes adds.

1A Quick Recap of What WebLogic Does for the Application

In Java EE, the application server is a runtime that our code lives inside. An EJB, an Enterprise JavaBean, is a class the server manages: it creates instances, wraps every business method in a transaction and checks security before the method runs. This is called container-managed, because the container (the server) does the work instead of our code.

A message-driven bean is an EJB the server calls when a JMS message arrives. An EJB timer is a persisted scheduled callback that fires on one node of the cluster. JAX-RS is the Java EE standard for REST endpoints, and JNDI is a directory where the server publishes resources such as jdbc/OrdersDS for lookup by name.

Spring Boot is not a server we deploy into; it builds these pieces inside our own process. So the migration moves each responsibility from the server into the application, one by one.

2Taking an Inventory of Server Features

Before any code changes, we search the code and the WebLogic configuration for what is actually used: annotations such as @Stateless, @MessageDriven, @Schedule and @RolesAllowed, InitialContext lookups, descriptors like ejb-jar.xml and weblogic-ejb-jar.xml, and server settings for JMS modules, data sources, realms and session replication. The result is a table per application that doubles as a progress tracker.

Inventory and Spring mapping
Java EE featureWhere we find itSpring Boot replacement
Container-managed transactions@Stateless beans, ejb-jar.xml@Transactional on Spring beans
Message-driven beans@MessageDriven, JMS modules@JmsListener with the broker's JMS client
EJB timers@Schedule, TimerService@Scheduled plus ShedLock, or Quartz in cluster mode
Security realms, @RolesAllowedweblogic.xml, realm configSpring Security with LDAP or OIDC
JNDI lookupsInitialContext, @ResourceInjected beans and properties
Cluster session replicationweblogic.xml session settingsStateless design or Spring Session
JAX-RS resources@Path classesSpring MVC, or Jersey via starter
One row per feature, filled in for each application before migration starts.

Notice that some features, such as session replication or XA transactions spanning the database and a JMS queue, are configured in the server, not in Java files. They are exactly the ones that change behaviour after the move.

3Mapping Each Feature to Spring

Most mappings are mechanical once we know they are needed. A stateless session bean becomes a Spring @Service, and the transaction the container used to start becomes an explicit @Transactional. A message-driven bean becomes a method annotated with @JmsListener, using the JMS client of whatever broker we keep (WebLogic JMS itself, or a broker such as ActiveMQ Artemis or IBM MQ).

Java
// Before: an EJB with a timer
@Stateless
public class InvoiceJob {
@Schedule(hour = "2", persistent = true)
public void closeDay() { /* ... */ } // fires once per cluster
}
// After: a Spring bean, locked so only one pod runs it
@Component
public class InvoiceJob {
@Scheduled(cron = "0 0 2 * * *")
@SchedulerLock(name = "closeDay", lockAtMostFor = "PT30M")
public void closeDay() { /* ... */ } // fires on every pod, but only one gets the lock
}

The timer is the classic trap. A persistent EJB timer fires once for the whole cluster, but a plain @Scheduled method fires on every pod, because Spring's scheduler knows nothing about other instances. With four replicas the nightly job runs four times. So we add a database lock with ShedLock, or use Quartz in cluster mode when jobs need persistence and misfire handling.

JNDI lookups disappear: the class receives a DataSource through its constructor, built by Spring Boot from spring.datasource properties. Security realms become Spring Security talking to the same LDAP directory or an OIDC provider, and @RolesAllowed can stay with @EnableMethodSecurity(jsr250Enabled = true).

4Why Transaction Behaviour Needs Special Care

Transactions are where a migration that compiles can still be wrong. In EJB, every business method of a session bean is transactional by default, with the attribute REQUIRED, even with no annotation at all. In Spring, nothing is transactional unless we say so. A method we forget to annotate silently becomes several small auto-committed statements, and a failure halfway leaves half-written data.

Rollback rules look similar but differ at the edges. EJB rolls back on system exceptions, meaning unchecked exceptions and RemoteException, and not on checked application exceptions, unless the exception class is marked @ApplicationException(rollback = true). Spring by default also rolls back on unchecked exceptions and not on checked ones, but it ignores @ApplicationException, so an unchecked exception that EJB treated as no-rollback will roll back in Spring. We translate those cases into rollbackFor and noRollbackFor attributes.

Java
@Service
public class PaymentService {
@Transactional(rollbackFor = PaymentDeclinedException.class) // checked: no rollback unless we say so
public void pay(Order o) throws PaymentDeclinedException { /* ... */ }
}

The biggest difference is distributed transactions. WebLogic can run one XA transaction across the database and a JMS queue; Spring Boot without a JTA manager has two separate transactions. We either add a JTA manager such as Narayana, or redesign with an outbox table written in the same database transaction and published afterwards by a relay.

5What to Do With the JAX-RS Endpoints

We have two honest options for the REST layer. We can rewrite the resources as Spring MVC controllers, which gives one programming model and full support from Spring's tooling. Or we can keep the JAX-RS classes unchanged and run them on Jersey with spring-boot-starter-jersey, registering them in a ResourceConfig bean.

Keeping Jersey reduces risk in the first wave, because the endpoints and their exception mappers stay exactly as they were. We can convert them to Spring MVC later, one resource at a time, once the rest is stable.

6Migrating in Steps With Tests and a Parallel Run

Before touching anything, we write characterisation tests: tests that record what the application does today, right or wrong, by calling its endpoints and checking responses and database effects. They are our safety net, because the goal of the migration is the same behaviour on a new runtime, not better behaviour.

Step throughMigration plan for one application
  1. Inventory server featurescode, descriptors and server config
  2. Write characterisation testsrecord today's behaviour
  3. Move one area to Spring BootJersey kept, transactions mapped
  4. Parallel run against WebLogiccompare responses and data
  5. Differences explained?
    YesyesNoswitch traffic gradually
  6. Retire the WebLogic deploymentafter a fallback period

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

Then we move one area at a time. A parallel run replays real requests against the new Spring Boot version and compares the results with WebLogic, while only the old system's responses reach users. When differences are understood, we switch traffic gradually and keep WebLogic as a fallback for a while.

7Adding What Kubernetes Expects

Kubernetes adds its own requirements that WebLogic never asked for. Configuration moves out of the server console into environment variables and ConfigMaps, with secrets in Kubernetes Secrets or a vault. Health probes come from Spring Boot Actuator: when it detects Kubernetes it exposes liveness and readiness groups at /actuator/health/liveness and /actuator/health/readiness, so the platform knows when to restart a pod and when to send it traffic.

Logs go to standard output as structured JSON (logging.structured.format.console in Spring Boot 3.4 and later) for the cluster's log collector. Graceful shutdown lets in-flight requests and messages finish when a pod stops, and because pods come and go, the application becomes stateless or keeps HTTP sessions in Spring Session with Redis instead of WebLogic's session replication.

8Follow-up questions

How would you handle XA transactions between the database and JMS after the move?

I would first check whether the code truly needs atomicity between the two. If it does, the usual modern answer is the transactional outbox: the service writes the outgoing message to an outbox table in the same database transaction as the business data, and a separate relay, or a CDC tool such as Debezium, publishes it to the broker. Consumers are made idempotent because the relay may publish a message twice. A JTA manager such as Narayana is the alternative when changing the design is not possible.

Would you containerise WebLogic first and migrate later?

It can be a sensible intermediate step when the deadline is driven by data centre exit rather than by licence cost, because it moves the infrastructure without touching code. But it keeps the licence and the server's operational model, and it often delays the real migration. I would only do it with an agreed date for the Spring Boot step.

9Conclusion

In this answer, we saw that migrating from WebLogic to Spring Boot means moving each server responsibility into the application. We built an inventory of transactions, JMS, timers, security realms, JNDI and clustering, mapped each to Spring, and looked closely at transactions, where implicit EJB transactions, rollback rules and XA differ. We kept JAX-RS on Jersey to lower risk, migrated in steps behind characterisation tests and a parallel run, and added configuration, health probes, structured logging and graceful shutdown for Kubernetes.

What to say in the interviewAbout 80 seconds aloud

Open with

I would start with an inventory, because the application server does a lot that is not visible in the code. For each application I list container-managed transactions, message-driven beans and JMS configuration, EJB timers, security realms, JNDI lookups, and cluster features like session replication or XA transactions.

Then, if they want more

Then I map each one: stateless beans become Spring services with explicit @Transactional, message-driven beans become @JmsListener methods using the broker's client, timers become @Scheduled with ShedLock or Quartz in cluster mode so they do not run on every pod, and the realm becomes Spring Security.

For JAX-RS, I would keep the resources on Jersey with the Spring Boot Jersey starter at first, to reduce risk, and convert to Spring MVC later if we want.

I am careful with transactions: EJB methods are transactional by default and Spring ones are not, Spring ignores @ApplicationException, and XA between JMS and the database needs either a JTA manager or an outbox.

Before changing code I write characterisation tests, then I migrate one area at a time and do a parallel run against WebLogic, comparing results before switching traffic gradually. Finally I add what Kubernetes needs: configuration from environment and ConfigMaps, Actuator liveness and readiness probes, JSON logs to standard output, graceful shutdown, and stateless pods.

About this answer

Last updated
12 November 2026
Versions it names
Spring Boot 3.4
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 "You are leading a migration of a large Java EE application running on WebLogic with...": https://scrivio-interview-library.netlify.app/architecture/modernization/b6bda0c922/