Building ear, jar and war

Do I need a special tool to build the ear, jar and war files necessary for a J2EE application?
And where can I find such tools?

you don't need a special tool, with the jdk you have a command jar who make special file. The syntax is jar -cvf name.jar <directory>. jar only display you the correctly syntax.
For the ejb.jar you have to respect the tree of the application with the directory meta-inf
For the project.war you do hace the web-inf directory with web.xml
For the project.ear you have to add the .jar and the .war into and a dirctory meta-inf with the fila application.xml
If you find this too difficult some products like Jdevelopper make this very correctly

Similar Messages

  • How to implement singleton service if i m using only jar and war component

    hello,
    in my application i m using only jar and war component .
    as i m not using EAR for deployment so i dont have weblogic-application.xml file.
    so in this case how i implement weblogic singleton service .and how to call active method

    From the documentation:
    After you have created a singleton service class using the SingletonService interface, you must define it as a singleton service within WebLogic Server. This singleton service object contains the following information:
    The path to the class to load as the singleton service.
    The preferred server and other candidate servers for the singleton service.
    The following excerpt from the cluster element of config.xml shows how a singleton service is defined:
    <singleton-service>
    <name>SingletonTestServiceName</name>
    <user-preferred-server>myManaged1</user-preferred-server>
    <class-name>mycompany.myprogram.subpackage.SingletonTestServiceImpl</class-name>
    <cluster>myCluster</cluster>
    </singleton-service>
    Note that the config.xml is located in the <domain-home>/config directory

  • Jar and war name conflict

    Hi All,
    When ever I try to deploy a jar and a war with same name only one will be deployed
    other doesn't. For example hello.jar and hello.war, In this set I can only deploy
    one. Do any one has reply.
    Thanks in Advance
    Surendra

    barry wrote:
    Is is possible to have exploded jars and wars in the exploded ear. Yes
    I mean, to hava a structure like that:
    /AppliEjb
    /AppliEjb/META-INF /AppliWeb/
    /AppliWeb/WEB-INF /META-INF
    And how to write application.xml:
    <ejb>AppliEJB</ejb> or <ejb>/AppliEJB</ejb> ... ? The module-uri in the application.xml is just the directory name. In
    your case it would be AppliEjb or AppliWeb (case-sensitive).
    -- Rob
    >
    Thanks

  • What is the difference between JAR and WAR

    would u pls tell me how to answer the Diffrences between JAR and WAR, if interwiever asked

    I hope you know what a JAR file is. If not, you need to study the Deployment trail in The Java Tutorial.
    If you have basic knowledge about programming web applications in Java, you should also know what a WAR file is. It's a special kind of JAR file that contains a standard directory structure, which includes a WEB-INF directory with the deployment descriptor and other parts of the web application.

  • How to deploy ear file with jar file and war file with different names

    Hi,
    As part of weblogic migration from WL 6.1 sp3 to WL 10, Iam facing some problem.
    Problem:
    I have one ear file(abc.ear) to deploy which contains one jar file(xyz.jar) and one war file(pqr.war).
    In config.xml file of WL 6.1, it was mentioned as :
    <Application Deployed="true" Name="abc" Path="./config/mydomain/applications/abc.ear">
    <EJBComponent Name="xyz" Targets="myserver" URI="xyz.jar"/>
    <WebAppComponent Name="pqr" Targets="myserver" URI="pqr.war"/>
    </Application>.
    The above is working fine.
    But in config.xml file WL10,I cannot mention the same.
    I need to have different application anmes for ear,jar and war.If I deploy as a ear file,the jar and war files are deployed with the same ear file name.
    I tried the following options:
    1) Deploying as a ear file by adding <sub-deployments>
    2) Deploying both war and jar seperately which is not recommended in my application.
    Please provide the content I should place in the config.xml so that everything works fine correctly.
    Any help is appreciated.

    Hi,
    As part of weblogic migration from WL 6.1 sp3 to WL 10, Iam facing some problem.
    Problem:
    I have one ear file(abc.ear) to deploy which contains one jar file(xyz.jar) and one war file(pqr.war).
    In config.xml file of WL 6.1, it was mentioned as :
    <Application Deployed="true" Name="abc" Path="./config/mydomain/applications/abc.ear">
    <EJBComponent Name="xyz" Targets="myserver" URI="xyz.jar"/>
    <WebAppComponent Name="pqr" Targets="myserver" URI="pqr.war"/>
    </Application>.
    The above is working fine.
    But in config.xml file WL10,I cannot mention the same.
    I need to have different application anmes for ear,jar and war.If I deploy as a ear file,the jar and war files are deployed with the same ear file name.
    I tried the following options:
    1) Deploying as a ear file by adding <sub-deployments>
    2) Deploying both war and jar seperately which is not recommended in my application.
    Please provide the content I should place in the config.xml so that everything works fine correctly.
    Any help is appreciated.

  • Ears, wars, support jars, and CLASSPATH

    I am trying to migrate an application from WLS 5.1 to 6.1. There are 25
    EJB jars with an equal number of support jars, most of which are referenced
    by multiple EJBs. There are also a large number of jsps, and html pages.
    I have tried packaging an ear that contains the 25 ejb jars, a war file
    containing the web pages. I have attempted to include the support jars in
    the ear as well.
    In all attempts, the only way I get class references sastisfied is to
    include all the jars on the system CLASSPATH. But this defeats the purpose
    of packaging, since none of the components referenced in the system
    CLASSPATH will be re-deployable.
    The online documents refer to separate class loaders and classpaths for the
    war and ejbs, but no detail as to how classes are found by the loaders.
    Unless I put all the jars into the CLASSPATH, jsp pages cannot reference the
    EJBs, and EJBs are unable to reference other EJBs.

    Thanks,
    Now if I could just get Webgain Visual Cafe to allow me to include the
    Classpath entries in the generated manifests for the EJB jars.
    "Gregory Gerard" <[email protected]> wrote in message
    news:3ba24da1$[email protected]..
    You need to mangle all the Manifest files within the EAR and EJB-JARs and
    WAR to get the right thing to happen. Check out this PDF on Sun's site:
    http://java.sun.com/j2ee/j2ee-1_3-pfd4-spec.pdf
    section 8.1.1.2
    I don't entirely understand all the restrictions and formatting -- Ihaven't
    found an example ear file out there that implements a non-trivial case.
    greg
    "Carl Lawstuen" <[email protected]> wrote in message
    news:3ba21d8e$[email protected]..
    I am trying to migrate an application from WLS 5.1 to 6.1. There are
    25
    EJB jars with an equal number of support jars, most of which arereferenced
    by multiple EJBs. There are also a large number of jsps, and htmlpages.
    I have tried packaging an ear that contains the 25 ejb jars, a war file
    containing the web pages. I have attempted to include the support jarsin
    the ear as well.
    In all attempts, the only way I get class references sastisfied is to
    include all the jars on the system CLASSPATH. But this defeats thepurpose
    of packaging, since none of the components referenced in the system
    CLASSPATH will be re-deployable.
    The online documents refer to separate class loaders and classpaths forthe
    war and ejbs, but no detail as to how classes are found by the loaders.
    Unless I put all the jars into the CLASSPATH, jsp pages cannot referencethe
    EJBs, and EJBs are unable to reference other EJBs.

  • EAR and WAR file deployment

    hi,
    Does anyone have information on how to use the EARASSEMBLER
    tool for creating ear files and war files?????
    thanks

    Hi Cheenai,
    EARASSEMBLER is an Orion tool and it is not supported in the
    current release of Oracle9iAS Containers for J2EE (even though
    it's bundled with the installation).
    You may download Oracle9i JDeveloper Release Candidate as the
    integrated development tool to build, assemble, package and
    deploy any J2EE applications (EJB-JAR, WAR, EAR files etc.):
    http://otn.oracle.com/software/products/jdev/content.html
    You may also download the "ant" command line tool to build and
    package J2EE files:
    http://jakarta.apache.org/ant/

  • Ear and War file difference

    I have created and loaded WAR files for Web Applications on my Tomcat 4.1.27 web container.
    I have also heard about EAR files and was wondering if I have the correct definition. On one of my Google searches it says: EAR files contain JAR files and WAR files.
    I assume an EAR file can contain many JAR and WAR files wrapped into one file (EAR)? Another way of looking at it is if I have for example 3 WAR files, I can put all 3 in an EAR file?

    All the archive files used in Java apps are basically ZIP files with the extension changed.
    JARs are used to package classes.
    WARs are used to package web applications ( the complete directory structure are mandated by J2EE specs ) and may contain JARs
    EARs are used to package a J2EE application ( think web app + EJBs in general ) and may consist of many web modules packaged as WARs.
    Take a look at this too: http://searchwebservices.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid26_gci837938,00.html
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • What is the differences between Ant build jar and eclipse export jar ?

    I have tried the eclipse export method to generate a jar file, however, it doesn't work with my server. But when I write a ant build file to create jar file. It works!!
    Does any buddies know why?

    Difference betwen JAR AND WAR
    .jar files: These files are with the .jar extension. The .jar files contain the libraries, resources and accessories files like property files.
    .war files: These files are with the .war extension. The war file contains the web application that can be deployed on the any servlet/jsp container. The .war file contains jsp, html, javascript and other files for necessary for the development of web applications.
    Source:
    http://forum.java.sun.com/thread.jspa?threadID=485823&messageID=2273976
    The main difference between a JAR and a WAR is that a JAR is not really a single purpose format, while a WAR is. With a JAR file, you can package lots of different things. Usually you package up Java classes, but you could put pretty much anything into a JAR file, and you can create JARs that have whatever files and directory formats you want. For instance, Oracle (at least in 8.1.x) actually uses JAR files to distribute the Oracle software on the install CDs, and IBM uses them to distribute an installable version of the documentation for WebSphere. Technically you can put JSP pages, HTML pages, servlet classes, etc. in a JAR, but you generally don't -- you use a WAR.
    WAR files are JAR files with a specific format. This format is defined in the servlet spec (which you can look at on the java.sun.com site). Essentially, the WAR file is a standard format for web applications that has specific directories and specific files. This includes a WEB-INF directory, a WEB-INF/web.xml file used to describe the application, a WEB-INF/lib directory for JAR files used by the application, and a WEB-INF/classes directory for class files that aren't distributed in a JAR. You would put the pages (JSPs and HTML) in the WAR as well. Then, you can distribute your application as one file, instead of as a collection of images, HTML pages, and Java classes.
    Source:
    http://www.theserverside.com/discussions/thread.tss?thread_id=10905
    Message was edited by:
    lochdsmile

  • Explain about JAR,EAR and WAR files

    Explain :what is JAR,EAR and WAR files and how is useful in creating archive files in java with more example?

    Please look up this type of information on your own.
    http://java.sun.com/reference/glossary/index.html

  • Common JAR file between EJB and WAR inside an EAR

    Hi,
    I'm trying to deploy an EAR application outside the development environment and I have the following problem.
    My EAR has the following structure :
    application.ear
    |-- ejbs.jar
    |-- web.war
    Inside the WAR, in /WEB-INF/lib/, I have a set of JAR files that are used by the Web app and also, of course, by the EJB.
    During the deployment step, EJB module cannot be deployed because it miss some classes into the classpath.
    I think it is a common problem in J2EE development, so does someone has a solution for this problem ?
    Please note I'm using Macromedia JRun 4 SP1 on Windows XP.
    Regards,
    Damien.

    Ok,
    I have found a solution that seems elegant to me. I'm going to try and explain...
    My appli.jar EJB module and my appli.war Web module are using both two JAR, let's say common.jar and util.jar.
    The way to share those JAR between the two modules is to have the following structure for the EAR :
    appli.ear
      |-- appli.jar
      |-- appli.war
      |-- common.jar
      |-- util.jar
      |-- META-INF
           |-- application.xml
           |-- manifest.mfIn this structure :
    * the common.jar and the util.jar are not part of the WAR (/web-inf/lib)
    * the manifest.mf file has the following content :
    Manifest-Version: 1.0
    Created-By: My Application
    Class-Path: common.jar util.jarPlease note that space is used as separator for the classpath entry to allow independancy from OS.
    And you know what ? It works ! Well, on Macromedia JRun 4.0 SP1 and on Windows XP but I hope it works on other platforms.
    I hope it will help a lot of people because I spent a lot of time before to find a solution !
    Regards,
    Damien.

  • Where to put utility jar (used by EJB's and war)

    Hello all,
    In many cases when you create a web application including EJB's and a WAR file packaged together in an EAR file, you need some utility classes that are used in the EJB's as wel as in the servlets in the WAR. The utility classes might for example be value object classes that servlets use to exchange data with te EJB's.
    My question is: What is the best place to put the utility class files?
    There is a new article on JDC: http://developer.java.sun.com/developer/technicalArticles/J2EE/build/ that gives some tips. For example, it proposes to put the utility JAR in the EAR file and then add a "Class-Path:" entry to the MANIFEST.MF of the EJB's that use the utility classes.
    However, this approach does not work on BEA Weblogic 6.0. Weblogic's classloader just seems to ignore the "Class-Path:" in the EJB JAR's manifest.
    Any thoughts?
    regards
    Jesper

    The "CLASS-PATH" mechanism in that article is a new
    requirement in J2EE 1.3 (final draft 4). Therefore
    right now Weblogic does not support it yet. Now you
    need to put those utility classes in both the WAR (in
    WEB-INF/lib) and EJB JAR files. If you really want
    only 1 copy of the jar file deployed, you can manually
    add that jar file to weblogic server classpath in the
    start script under config/yourdomain.HI all,
    I have some Utility jar file for EJB and Web Application,
    In the second solution about one copy in weblogic,
    I tried it in the WLS60 it's ok
    But it didn't work in WLS61
    Anyone could give me any good suggestion?
    Moen

  • Why use ojdeploy when building ViewController jar/war?

    Hi,
    It is known that ojdeploy is the recommended way to go when building/deploying an ADF app. The advantages are stated in many blog posts in the web.
    IMHO the most important reason for using ojdeploy instead of javac when creating an EAR is that javac CANNOT validate your BC. This means for example that if you refactor-rename an attribute of a VO and then commit only xml and not the related View Row Impl class, the build in your CI server will succeed if using only javac and fail if using ojdeploy (as it should be). So ojdeploy is the only way when building jars of Model projects if you want to be 100% sure the you have valid ADF code.
    The question is if the is a similar reason for using ojdeploy when building ViewController jars/wars??
    Thanx in advance for any feedback.
    Spyros Doulgeridis
    adfhowto.blogspot.com
    Edited by: spido on Jul 6, 2011 10:04 AM

    ojdeploy makes changes to your descriptors javac or jar does not know about. Actually nobody knows about the changes as you have to look into the war to see them. I'm not even sure that they are documented.
    Timo

  • How to make ear and war file

    hi ,
    can anyone tell me how to make the ear and war file ??/
    Regards,
    Shruti.

    hello shruti
    to make war file enter the following command through command prompt
    jar -cvf filename.war give one space then .(dot)
    bye

  • EAR and WAR

    Hi,
    i need to know about .ear and .war,what exactly do in atg. why we use.
    thanks.

    They are the standard file formats for storing and distributing JEE applications. A War file groups JSPs, servlets and all related files to create web applications, and a Ear file groups all the various War and Jar files required to create an 'enterprise' application.
    Hope this helps.

Maybe you are looking for

  • HTTP_RESP_STATUS_CODE_NOT_OK 500 error

    hi all, i am working on xi to LDAP connectivity, for this iam using java proxy, when iam executing the scenario, i am getting the follwing error in sxmb_moni can any one help me SAP:Category>XIServer</SAP:Category>   <SAP:Code area="INTERNAL">HTTP_RE

  • Make separate pages in Number '09

    I am creating a Table of Contents; would like each letter of the alphabet to be a new page. How do I create 26 separate pages without adding/deleting rows? I will be adding new entries constantly so adding/deleting rows would be too cumbersome.

  • Thread creation in c++

    Hi, all ! I am working on a c++ program. I have created a class called threads abnd now I want to know whether there is a function for creating threads.I am new to solaris.I don't have a idea about what function to use to create threads in c++. I als

  • MOVED: A check on my settings to get the best out of them.

    This topic has been moved to Overclockers & Modding Corner. https://forum-en.msi.com/index.php?topic=143380.0

  • Browse sequence has disappeared.

    The browse sequences for my CHM files are fine when I select View after generating the help but when I open the CHM file from the output folder (on my local drive) I cannot see the browse sequences. This seems to have happened suddenly and for all of