Skip to content

peshliya/Java-EJB-JNDI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ό Java-EJB-JNDI Example Project

A simple, educational example of using Enterprise JavaBeans (EJB) and Java Naming and Directory Interface (JNDI) with Jakarta EE and GlassFish. This project demonstrates how multiple standalone clients can interact with a shared EJB and access a common JNDI registry.


πŸ“ Project Structure

Java-EJB-JNDI/ β”œβ”€β”€ EE-WebApp/ # EJB module (remote business logic)

β”œβ”€β”€ EE-Client-App/ # Client #1 - performs remote EJB call and binds data

└── EE-Client-App2/ # Client #2 - retrieves shared data from JNDI


πŸ”§ Technologies Used

  • β˜• Java 11
  • 🌐 Jakarta EE 10
  • πŸ“¦ EJB (Enterprise Java Beans)
  • 🧭 JNDI (Java Naming and Directory Interface)
  • 🐬 GlassFish 7.0.21 (remote + embedded)
  • πŸ›  Maven

🧩 Module Breakdown

πŸ“¦ EE-WebApp/ β€” EJB Module (Server-side)

  • πŸ“Œ Purpose: Hosts remote business logic via a remote interface.
  • πŸ§ͺ Implements: UserDetailsBean (an EJB)
  • πŸ”Œ Exposes: UserDetails interface using @Remote
  • πŸš€ Deployment: Build and deploy .jar to GlassFish

πŸ’» EE-Client-App/ β€” Standalone Java Client #1

  • πŸ” Performs: JNDI lookup of the UserDetails EJB
  • πŸ§‘ Retrieves: User's name from the remote bean
  • πŸ”— Binds: "AppName" string to JNDI for other clients to use

πŸ’» EE-Client-App2/ β€” Standalone Java Client #2

  • πŸ” Looks up: "AppName" from the JNDI context
  • πŸ“€ Reads and Prints: Shared string set by Client #1

About

This is a basic example showing how to use Enterprise JavaBeans (EJB) and JNDI. It includes a simple stateless EJB and a Java client that connects to it using JNDI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages