This project demonstrates the implementation of a distributed Java EE application using EJB3, JPA, and MySQL. The goal is to create a modular and scalable system that manages student data with full CRUD operations.
To practice and implement a distributed JEE application by leveraging EJB3, JPA, and WildFly. The application performs CRUD operations on student data stored in a MySQL database.
- Distributed Architecture: EJB Session Beans for modular and reusable components.
- CRUD Operations: Full management of student data (create, read, update, delete).
- Database Integration: Persistent storage with JPA and MySQL.
- Dynamic Web Application: Servlet-based frontend consuming remote EJB methods.
- Standards-Compliant: Built with Jakarta EE standards, ensuring portability and scalability.
Technology | Purpose |
---|---|
EJB3 | Business logic with Session Beans |
JPA | Database persistence layer |
MySQL | Relational database management |
WildFly | Application server |
IntelliJ IDEA | Development environment |
Maven | Dependency management and build |
src/
βββ ejb/
β βββ META-INF/
β β βββ persistence.xml # Persistence configuration
β βββ com.example.ejb/
β β βββ Etudiant.java # JPA Entity for students
β β βββ EtudiantSessionBean.java # EJB Session Bean for CRUD
β β βββ EtudiantRemote.java # Remote interface
βββ web/
β βββ WEB-INF/
β β βββ web.xml # Web application configuration
β βββ com.example.web/
β β βββ AddStudentServlet.java # Servlet for adding a student
β β βββ ViewStudentServlet.java # Servlet for viewing students
β β βββ UpdateStudentServlet.java # Servlet for updating a student
β β βββ DeleteStudentServlet.java # Servlet for deleting a student
Prerequisites :
- Java 11+ installed.
- Maven for project management.
- MySQL with a database named Getudiants.
- Clone the Repository:
git clone https://github.com/YourUsername/Distributed-JEE-Application.git
cd Distributed-JEE-Application
Set Up the Database:
- Create a MySQL database:
CREATE DATABASE Getudiants; Update persistence.xml with your MySQL credentials:
<property name="hibernate.connection.username" value="your-username" />
<property name="hibernate.connection.password" value="your-password" />
Deploy the EJB Module:
mvn clean package
- Deploy the EJB JAR to your WildFly server:
Deploy the Web Module Package the web project using Maven:
mvn clean package
- Deploy the WAR file to WildFly: Access the Application:
Open your browser and navigate to the web application:
http://localhost:8080/your-webapp-context