A multi-module Jakarta EE enterprise application demonstrating Session Beans, Message-Driven Beans, JMS messaging, asynchronous processing, and real-time system monitoring, built on Payara Server 6.
TechMart Online is an enterprise-grade e-commerce platform built to modernise a legacy monolithic system that struggled beyond 1,000 concurrent users. The rebuilt system runs on Jakarta EE 10 and Payara Server 6, using Session Beans (Stateless, Stateful, Singleton), Message-Driven Beans, JMS (point-to-point and publish/subscribe), and JNDI-based dependency injection to deliver:
- β‘ Real-time inventory synchronisation across multiple warehouses
- π¦ Automated, asynchronous order processing
- π Live promotion broadcasts via WebSocket + JMS
- π A live admin dashboard with system health & performance metrics
- β 126 passing JUnit 5 unit tests across the entire business-logic layer
- π Customer registration & login (BCrypt password hashing)
- ποΈ Product catalogue browsing & single-product detail pages
- π Stateful shopping cart (per-session, in-memory)
- π³ Checkout with address management & PayHere payment gateway integration
- π Real-time promotion notifications via WebSocket
- π Live system health dashboard (memory, DB connections, JMS queue depth)
- π¦ Inventory control across multiple warehouses
- π§Ύ Order and customer management
- π·οΈ Product, category, brand & promotion management
- π₯ Staff account & role management
- π¦ Built-in traffic simulator for load testing (
/api/simulate-traffic)
- Stateless, Stateful & Singleton EJBs with lifecycle-optimised design
OrderProcessorMDBβ point-to-point JMS consumer (15-session pool) for order fulfilmentPromoNotificationMDB/WebSocketNotifierMDBβ publish/subscribe JMS for promotions@Asynchronousload-simulation service returningFuture<String>- JNDI-managed connection pooling (
TechMartPool) and JMS resources
| Layer | Technology |
|---|---|
| Language | Java 17 |
| Platform | Jakarta EE 10 |
| Application Server | Payara Server 6 |
| Persistence | Jakarta Persistence API (JPA) + Hibernate 6 |
| Database | MySQL 8 (via TechMartPool JDBC connection pool) |
| Messaging | Jakarta Messaging (JMS) β Queue + Topic |
| Security | jBCrypt password hashing |
| Frontend | JSP, JSTL, HTML/CSS/JS, WebSocket |
| Build Tool | Apache Maven (multi-module) |
| Testing | JUnit 5, Mockito |
| Performance Testing | Apache JMeter, VisualVM |
| IDE | IntelliJ IDEA |
flowchart TB
subgraph Client["π Client Browser"]
A1[Customer Storefront]
A2[Admin Dashboard]
end
subgraph Presentation["Presentation Tier"]
B1["techmart-web<br/>JSP + Servlets + WebSocket"]
B2["admin-web<br/>JSP + Servlets + REST APIs"]
end
subgraph Business["Business Logic Tier β techmart-ejb"]
C1["Stateless Beans<br/>Auth, Orders, Payments, Catalogue"]
C2["Stateful Bean<br/>ShoppingCartBean"]
C3["Singleton Beans<br/>SystemMonitorBean, StockManagerBean"]
C4["Message-Driven Beans<br/>OrderProcessorMDB, PromoNotificationMDB"]
end
subgraph Messaging["Messaging"]
D1["jms/OrderQueue<br/>(Point-to-Point)"]
D2["jms/PromoTopic<br/>(Publish/Subscribe)"]
end
subgraph Data["Data Tier"]
E1[("MySQL 8<br/>TechMartPool")]
end
A1 --> B1
A2 --> B2
B1 -->|"@EJB"| C1
B1 -->|"@EJB"| C2
B2 -->|"@EJB"| C1
B2 -->|"@EJB"| C3
C1 -->|"send"| D1
D1 -->|"consume"| C4
C1 -->|"publish"| D2
D2 -->|"consume"| C4
C1 -->|"JPA/Hibernate"| E1
C2 -->|"JPA/Hibernate"| E1
C3 -->|"JPA/Hibernate"| E1
C4 -->|"JPA/Hibernate"| E1
Deployment unit: all four modules are packaged by techmart-ear into a single .ear file and deployed to Payara Server 6.
TechMartOnline/
β
βββ techmart-ear/ # Root EAR β assembles all modules for deployment
β
βββ techmart-ejb/ # βοΈ Business logic tier (24 EJBs)
β βββ src/main/java/com/techmart/ejb/ # Session Beans & MDBs
β βββ src/main/java/com/techmart/notification/# Email/notification helpers
β βββ src/main/resources/META-INF/ # persistence.xml
β βββ src/test/java/com/techmart/ejb/ # 126 JUnit 5 test cases
β
βββ techmart-web/ # ποΈ Customer-facing storefront
β βββ src/main/java/com/techmart/web/ # Servlets
β βββ src/main/java/com/techmart/web/mdb/ # Web-tier MDB
β βββ src/main/java/com/techmart/web/websocket/# Real-time promo notifications
β βββ src/main/webapp/ # JSP pages, JS, images
β βββ home.jsp Β· login.jsp Β· register.jsp
β βββ cart.jsp Β· checkout.jsp Β· single-product.jsp
β
βββ admin-web/ # π Admin dashboard
β βββ src/main/java/com/techmart/api/ # REST-style metric/simulation APIs
β βββ src/main/java/com/techmart/filter/ # Auth/role filters
β βββ src/main/webapp/ # dashboard.jsp, manage-*.jsp
β
βββ techmart-core/ # π¦ Shared library
β βββ src/main/java/com/techmart/entity/ # JPA Entities
β βββ src/main/java/com/techmart/dto/ # Data Transfer Objects
β βββ src/main/java/com/techmart/remote/ # EJB @Local/@Remote interfaces
β βββ src/main/java/com/techmart/exception/ # Custom exceptions
β
βββ pom.xml # Parent Maven POM
- β JDK 17
- π¦ Apache Maven 3.9+
- π Payara Server 6
- π¬ MySQL 8
- IntelliJ IDEA (recommended)
-
Clone the repository
git clone https://github.com/shan2003034/TechMartOnline.git cd TechMartOnline -
Create the database
CREATE DATABASE techmart_online;
-
Configure the JDBC Connection Pool in Payara
- Open Payara Admin Console β
Resources β JDBC β JDBC Connection Pools - Create a pool named
TechMartPoolusingcom.mysql.cj.jdbc.MysqlDataSource - Add a JNDI resource:
java:/TechMartPool
- Open Payara Admin Console β
-
Configure JMS Resources in Payara
Resources β JMS Resourcesβ create:- Queue:
jms/OrderQueue+ Connection Factoryjms/OrderQueueFactory - Topic:
jms/PromoTopic+ Connection Factoryjms/PromoTopicFactory
- Queue:
-
Build the project
mvn clean install
This compiles all modules, runs the JUnit test suite, and produces
techmart-ear/target/techmart-ear.ear. -
Deploy
- Drop the
.earfile into Payara'sautodeploy/directory, or - Deploy via Admin Console (
http://localhost:4848)
- Drop the
-
Access the application
App URL Customer Storefront http://localhost:8080/techmart/Admin Dashboard http://localhost:8080/admin/
cd techmart-ejb
mvn testThis runs all 126 JUnit 5 test cases (with Mockito mocking) covering every Stateless, Stateful, Singleton and Message-Driven Bean in the business logic layer. Reports are generated under target/surefire-reports/.
Performance and scalability were additionally validated using Apache JMeter and VisualVM against the deployed application (see the project's Test Report for full results).
Prasanna Lakshan
- π Portfolio: https://prasanna-lakshan.vercel.app/
- πΌ LinkedIn: https://www.linkedin.com/in/prasannalakshan
- π GitHub: https://github.com/shan2003034














