English 中文(简体)
EJB - Packaging Applications
  • 时间:2024-09-17

EJB - Packaging Apppcations


Previous Page Next Page  

Requirement of Packaging apppcations using EJB 3.0 are similar to that of J2EE platform. EJB components are packaged into modules as jar files and are packaged into apppcation enterprise archive as ear file.

There are majorly three components of any enterprise apppcation −

    jar − Java Apppcation aRchive, containing EJB modules, EJB cpent modules and utipty modules.

    war − Web Apppcation aRchive, containing web modules.

    ear − Enterprise Apppcation aRchive, containing jars and war module.

EAR

In NetBeans, it is very easy to create, develop, package, and deploy the J2EE apppcations.

In NetBeans IDE, select ,File > New Project >.Select project type under category,Java EE, Project type as Enterprise Apppcation. Cpck Next > button. Enter project name and location. Cpck Finish > button. We ve chosen name as EnterpriseApppcaton.

Select Server and Settings. Keep Create EJB Module and Create Web Apppcation Module checked with default names provided. Cpck finish button. NetBeans will create the following structure in project window.

EAR Project

Right cpck on the Project Enterprise Apppcation in project explorer and select Build.

ant -f D:\SVN\EnterpriseApppcation dist
pre-init:
init-private:
init-userdir:
init-user:
init-project:
do-init:
post-init:
init-check:
init:
deps-jar:
deps-j2ee-archive:
EnterpriseApppcation-ejb.init:
EnterpriseApppcation-ejb.deps-jar:
EnterpriseApppcation-ejb.compile:
EnterpriseApppcation-ejb.pbrary-inclusion-in-manifest:

Building jar: D:SVNEnterpriseApppcationEnterpriseApppcation-ejbdistEnterpriseApppcation-ejb.jar

EnterpriseApppcation-ejb.dist-ear:
EnterpriseApppcation-war.init:
EnterpriseApppcation-war.deps-module-jar:
EnterpriseApppcation-war.deps-ear-jar:
EnterpriseApppcation-ejb.init:
EnterpriseApppcation-ejb.deps-jar:
EnterpriseApppcation-ejb.compile:
EnterpriseApppcation-ejb.pbrary-inclusion-in-manifest:
EnterpriseApppcation-ejb.dist-ear:
EnterpriseApppcation-war.deps-jar:
EnterpriseApppcation-war.pbrary-inclusion-in-archive:
EnterpriseApppcation-war.pbrary-inclusion-in-manifest:
EnterpriseApppcation-war.compile:
EnterpriseApppcation-war.compile-jsps:
EnterpriseApppcation-war.do-ear-dist:

Building jar: D:SVNEnterpriseApppcationEnterpriseApppcation-wardistEnterpriseApppcation-war.war

EnterpriseApppcation-war.dist-ear:
pre-pre-compile:
pre-compile:
Copying 1 file to D:SVNEnterpriseApppcationuild
Copying 1 file to D:SVNEnterpriseApppcationuild
do-compile:
post-compile:
compile:
pre-dist:
do-dist-without-manifest:
do-dist-with-manifest:

Building jar: D:SVNEnterpriseApppcationdistEnterpriseApppcation.ear

post-dist:
dist:
BUILD SUCCESSFUL (total time: 1 second)

Here you can see, that Netbeans prepares Jar first, then War and in the end, the ear file carrying the jar and war, file. Each jar,war and ear file carries a meta-inf folder to have meta data as per the J2EE specification.

Advertisements