- EJB - Packaging Applications
- EJB - Web Services
- EJB - Exception Handling
- EJB - Query Language
- EJB - Access Database
- EJB - Entity Relationships
- EJB - JNDI Bindings
- EJB - Security
- EJB - Transactions
- EJB - Blobs/Clobs
- EJB - Embeddable Objects
- EJB - Interceptors
- EJB - Dependency Injection
- EJB - Timer Service
- EJB - Callbacks
- EJB - Annotations
- EJB - Message Driven Beans
- EJB - Persistence
- EJB - Stateful Bean
- EJB - Stateless Bean
- EJB - Create Application
- EJB - Environment Setup
- EJB - Overview
- EJB - Home
EJB Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
EJB - Packaging Apppcations
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.
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.
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