Hi Sachin,
Am trying to explain in detail...., 'war' files contains
jsp,
servlets, html etc., not the
ejb files. This 'war' can run in any web server like
Tomcat. But 'ear' files contains 'war' files as well ejb files. This will run in any Application server like
JBoss,Weblogic. And 'jar' files is basically used for only standalone applications.
Creating war & ear files
------------------------
(1) sample folder may contains java,jsp,servlets,html,jpeg etc., is converted into war file by this command.
C:\Tomcat4.1\webapps\sample>jar -cvf sample.war *
(2) sample folder may contains sample.war and ejbs with may also contains html,jpeg etc., is converted into ear file by this
command.
C:\Tomcat4.1\webapps\sample>jar -cvf sample.ear *
unzipping and extracting war & ear files
----------------------------------------
(1) C:\Tomcat4.1\webapps\sample1>jar -xvf sample.war.
it will unzip and extracts all its content files from sample.war file
(2) C:\Tomcat4.1\webapps\sample1>jar -xvf sample.ear.
it will unzip and extracts all its content files from sample.ear file
Creating the jar files
----------------------
Creating a deployment file after you finish developing your enterprise bean, you need to package all the class files into
one .jar file. For suppose, the ejb directory contains three files: Adder.class, AdderHome.class, and AdderBean.class. The
'METAINF' directory contains one file: the ejb-jar.xml file, the deployment descriptor.
Follow these steps to create the deployment file:
1. Change directory to the parent directory of both com and META-INF.
2. Assuming jar.exe is already in the path, type the following:
jar cfv adder.jar com/brainysoftware/ejb/* META-INF/ejb-jar.xml
3. This creates a jar file called adder.jar.