From cocoon to butterfly: Alibaba Cloud Application Server enables traditional J2EE applications to seamlessly upgrade to the AI-native era

Written by
Jasper Cole
Updated on:June-28th-2025
Recommendation

The core content of the guide to intelligent upgrade of traditional J2EE applications

:
1. Intelligent transformation challenges faced by J2EE applications
2. Progressive containerization technology of Alibaba Cloud application server
3. Practical application of dual-stack runtime environment and intelligent hub architecture

Yang Fangxian
Founder of 53AI/Most Valuable Expert of Tencent Cloud (TVP)

Smooth upgrade to embrace big models: Detailed explanation of the application intelligent upgrade path in the AI ​​era

From cocoon to butterfly: Alibaba Cloud Application Server enables traditional J2EE applications to seamlessly upgrade to the AI-native era

——No need to rewrite code in ten years, start intelligent transition in three steps


Prologue: A technical dialogue spanning 20 years

Cloud Native



In a conference room at a science park in Hangzhou, a special code review is underway. The screen simultaneously displays the supply chain system developed based on WebLogic in 2005 and the intelligent scheduling solution connected to the DeepSeek big model in 2025. Amazingly, the core business codes of the two remain amazingly consistent. "We have preserved the 238 core business objects accumulated over 20 years, just like preserving every historical trace when repairing a famous painting." The CTO of the company sighed, revealing the secret of how Alibaba Cloud Application Server helps traditional systems transform into intelligent systems.


Chapter 1

Dilemma: The pain of intelligent transformation of J2EE applications

Cloud Native


When classic architecture encounters the intelligent torrent  


Since the birth of informatization, application architecture has gone through three generations of architecture: monolithic, distributed, and cloud-native. Now, the application architecture of the entire industry is evolving towards intelligence. However, nearly half of the applications are still in the era of monolithic architecture represented by J2EE. In today's era of intelligence, traditional architecture generally encounters the following technical pain points when evolving:


  • Protocol gap : Communication between EJB components and microservices requires a complex protocol conversion layer. The complexity of the protocol also brings about technical and management complexity.

  • Resource conflict : When large model inference requests burst in, due to the limitation of GPU resources, low inference efficiency causes many requests to be blocked, further affecting the availability of online services.

  • Observation blindness : Modern APM systems are friendly to microservices, but many systems cannot track EJB calls, and are blind to access to AI models, causing this type of application to become an information island for observation. The disconnection of the link causes the time required for fault location to increase exponentially.




Chapter 2

Breakthrough: Genetic Recombination of Alibaba Cloud Application Server

Cloud Native


The Way of Compatibility: Breeding New Life from Classics 


Through the original "progressive containerization" technology, Alibaba Cloud has realized the intercommunication technology between traditional EJB containers and microservice systems based on Nacos. The architecture diagram is as follows:



Here is a sample code as a programmer writes it:


// Cloud native wakeup example for traditional J2EE applications@CloudEJBAdapter (name =  "springcloud-provider-demo" )public  interface  RemoteHello  extends  Serializable  {
    @GetMapping ( "/hello" )    String  hello ( String  name);}


Technical highlights:


  • Dual-stack runtime environment: supports both EJB3.0 and microservices (supports both Spring Cloud and Dubbo service frameworks)

  • Intelligent protocol conversion bridge: automatic conversion of RMI/REST/GRPC protocols

  • Hot-swappable module loading: loading microservices and intelligent components without restarting


Intelligent Hub: Plug-and-Play Architecture for Large Models  


Based on Alibaba Cloud's DashScope SDK, Alibaba Cloud has realized the intercommunication between traditional J2EE applications and large models in the application server. The architecture diagram is shown in the following figure:



(Architecture description: DashScope is used to achieve standardized docking with mainstream large models)


Three innovative designs:


1.  Model sandbox environment : Isolate large model inference thread pool resources to reduce the impact of AI business on traditional business

2.  Request current limiting : Introduce Model Filter to limit request current based on Token

3.  Prompt management : Prompt injection and dynamic management through the console


Panoramic observability: illuminating every corner of the system


In the process of digital transformation, many enterprises are facing typical technical architecture evolution dilemmas: the traditional EJB monolithic system is in a state of limited maintenance for a long time due to the accumulation of historical technical debt; emerging businesses use the Spring Cloud technology stack to build cloud-native microservice clusters; and the AI ​​intelligent wave has spawned tensor computing services based on large models. The coexistence of these three business generations has led to multi-dimensional challenges in the observation of the entire business link: the black box of the traditional JNDI remote call link, the distributed tracking fault of the microservice gateway, the lack of visualization of the computational graph of large model reasoning, and other observation gaps in heterogeneous technology stacks.



By introducing ARMS (Real-time Application Monitoring Service) to build a unified observability platform, full-stack tracing capabilities across J2EE legacy systems, microservice architectures, and AI computing engines can be achieved. This solution effectively penetrates the technical barriers of multiple businesses such as EJB service calls, microservice calls, and large model reasoning and computing, and provides an end-to-end perspective from traditional transaction processing to intelligent decision-making for core businesses such as order transactions, solving the system observability blind spot problem caused by the "technology generational fault" and building a global observation platform for the hybrid technology ecosystem.


Chapter 3 Actual Combat:

Three steps to enable J2EE intelligence emergence based on EDAS

Cloud Native



Step 1: Inject intelligence-related capabilities into the code


First configure the relevant parameters:


<!-- Intelligent service declarative configuration --><Resource name="modelClient" auth="Container" type="com.alibaba.ai.ModelClient" factory="com.alibaba.ai.ModelClientFactory"/>


Then introduce the relevant business code:


// New collaboration paradigm between Zhang (15 years of J2EE experience) and Li (AI engineer)public  class  HybridDeveloper  {    @EJB  // Traditional skills    private  OrderSystem legacySystem;
    @Resource(name= "modelClient" )  // New quality productivity    private  ModelClient client;
    @Prompt(name= "orderProcessor" )    private  PromptMessage prompt;
    public  Future<CompletionResponse> process(Order order) {        return  CompletableFuture.supplyAsync(() -> {            // Classical logic            legacySystem.validate(order); 
            // Intelligent enhancement            return  modelClient.chat().completions(prompt, order);         });    }}


Step 2: Select AliEE in Alibaba Cloud EDAS to deploy the corresponding application


AliEE was born out of AliTomcat, an e-commerce platform. It has been officially commercialized in Alibaba Cloud EDAS. In addition to one-click startup in Alibaba Cloud EDAS, it also supports independent stand-alone deployment. The one-click startup method in EDAS is as follows:



At the same time, the current popular deployment form is to embed the application server into the FatJar of the project. In this form, it is necessary to replace the Tomcat (or Jetty) dependency package in the POM dependency of the project, as shown below:


<!-- Step 1: Unregister the original Tomcat dependency<dependency>    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-starter-web</artifactId></dependency>-->
<!-- Step 2: Add AliEE dependency-->< dependency >    <groupId> io.cloudapp </groupId>    <artifactId> cloudapp - starter - aliee </artifactId></ dependency >


Step 3: Add model configuration in the management console


In the console, enter the model name, model address, Prompt and other parameters, as shown in the following figure:



After configuring the corresponding model parameters on the AliEE management console, these configurations will be sent to the AliEE process and will take effect in real time after dynamic loading and refreshing without restarting.


postscript




Cloud Native


When each wave of technology arrives, one of the pain points for governments and enterprises is the worry that the information assets of the previous generation will become debts. Alibaba Cloud, through the innovation of basic technologies, allows the wisdom of each era to be immortalized in the digital world. When classic J2EE applications bloom into intelligent flowers on Alibaba Cloud application servers, this quiet technological revolution is redefining the true value of enterprise digital assets.