Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an EJB module in Java EE 6?

When I go to create a new Java EE 6 project in eclipse I see a bunch of types of projects....

  • Enterprise Application
  • EJB Module
  • Enterprise Application Client
  • Packaged Archive

What are these different types and what do they mean?

like image 703
Webnet Avatar asked Dec 05 '11 03:12

Webnet


2 Answers

Java Enterprise Edition considers the following types of applications:

  1. Web Application. This is composed of Servlet, JSP, HTML, CSS, Images, etc. The main purpose is representing the User Interface layer. This applications runs over WebContariners such as Tomcat, a full Java EE Application Server must provide a Web container for deploy this kind of applications. Finally the artificat for deployment is a WAR archive.
  2. EJB Application. This is composed by Enterprise Java Beans (Stateless, Statefull, Message Driven) which provide to you the tools needed for build the Bussines Logic Layer. This applications runs over EJB Containers (Tomcat can’t run EJB applications, a full Java EE Application Server must provide an EJB container for deploy this kind of applications. Finally the artifact for deployment is a JAR archive
  3. Enterprise Application. This is a kind of wrapper for Web Application and EJB Applications. You can include inside of them to many Web or EJB applications. For deploy an Enterprise Application you need a full Java EE Application Server (Glassfish, JBoss, Weblogic, etc.). The artifact for deployment is a EAR file. Eclipse and Netbeans manage Web Applications and EJB applications as modules so yo later can group it into an Enterprise Applications

Finally in the Java EE 6 specification is defined the Web Profile schema for Applications Servers. This Web Profile let to you include in Web Applications EJB (with some limitations). For example the project TomEE merges Apache Tomcat with Apache OpenEJB in order to provide a server compatible with "Web Profile".

like image 159
Ernesto Campohermoso Avatar answered Sep 27 '22 18:09

Ernesto Campohermoso


EJB module produces a .JAR containing all your enterprise java beans.

An EAR file is to contain at least one JavaEE module, an EJB is a JavaEE module.

like image 33
Oh Chin Boon Avatar answered Sep 27 '22 18:09

Oh Chin Boon