EAR / WAR Packaging

Dear Expert,
Do you know whether there is any guildline for packing EAR/WAR according to the J2EE standard?
For example, whether
several projects should be packed into the same EAR/WAR in order to reduce the overhead of starting up the applications (ie, one EAR containning several WAR of different projects), or
each project should be packed in a standalone EAR and WAR (ie, one EAR containing one WAR for a single project), or
all projects should be packed in the same EAR/WAR (ie, one EAR containing one WAR for multiple projects)
Many thanks.

hi,
Have a look at http://java.sun.com/blueprints/guidelines/designing_enterprise_applications/packaging_deployment/applications/
-Amol

Similar Messages

  • Jdeveloper 9.0.3 support for a standard WAR / package issues

    We are being pitched on how wonderful the JDeveloper IDE is and how our days will be enlightened by it (the same folks that sold our company on o-apps 11i)... so I've been tryin' it out only to hit a MAJOR roadblock.
    Basically, we need CVS development across IDE's... which shouldn't be a problem if the non-proprietary stuff all works as planned. I've used forte' in the past with success.
    I am new to the JDeveloper environment. I have used Forte' before and the Sun J2EE dev. kit for deploying WARs and EAR's.. Using the tutorials provided by Sun, I found NO easy way to develop against the directory structure provided. I would also like to have ant build scripts exist in my project.. and the ability to define a source directory '/WEB-INF/src' which is my source package root, that builds to /WEB-INF/classes. NONE of this seems to be part of the 'web tier' in JDev. I've scoured the help even for the keyword 'package', and it has proven useless. And how do I specify package/folder structure in the workspace? It seems that JDev is so catered to Oracle and uneducated users that the 'more advanced' features.. (such as Java PACKAGE management.. (been there for awhile now :-} )) should be an essential feature. Help somebody!!!!
    PS... my ideal experience is:
    Me: Hi, Jdeveloper.. i want a project that will contain some WAR and/or ear development.
    JDev: Okay, where would you like the dev. root to go?
    Me: How about here, where I've already got something started (written per J2EE spec)
    JDev: Okay... hmm .looks like a WEB-INF folder exists with a web.xml IN it... do you want me to recognize it as a web app?
    me: sure
    Jdev: I see stuff in classes... shall i maintain them as servlets?... Oh by the way,,, i see your folders and package structure.
    you get the idea.
    what happened to WEB-INF?... any WAR packaging?.. not oo impressed yet.

    Yes, I examined the attribute settings and manually adjusted them in the entities and views. They are now updateable. Using Jdeveloper with SAPDB would be very tedious. Jdeveloper did not recognize foreign key constrains, primary keys, nor that attributes were updateable.
    Is there a way to include SAPDB in the testing? It is trivial to install and run and would make Jdeveloper a more robust tool. I do not like Jbuilder's approach to master-detail client screens and would recommend using Jdeveloper for this type of work if it could handle more databases like SapDb.

  • List the contents of jar, ear, war files

    Hi All,
    It has been several years since I have worked in java and now I am trying to get caught back up :-).
    My question is: Is there a standard utility that can dump/list the contents of the packaging files: jar, ear, war?
    Thanks in advance!

    You can use winzip. OR you can use the jar command provided in JDK.
    jar -tvf <<your archive (jar, war, ear)>>

  • Putting unix utility visible version info into ear, war, jar files?

    I would like to be able to use some unix utility (or java itself without a separate program) to display my version information for jar-like artifacts: ear, war, jar.
    In other words, when I build one of these things, I'd like to put my SVN version, date, user name, and maybe some other stuff into it in a way that can be read without a custom program. This needs to be done as part of the ant build (without requiring a custom java program).
    For example, one approach would be "strings | grep <special-string>" if I could put something, somewhere in the file that had this as 8-bit character encoding.
    For jars, making the jar executable and having the main print it out works, but I don't think that's do-able for ears and wars, and it would be desirable to have a consistent approach.
    Anyone already doing this?
    Ideas?

    For example, I don't think you can specify a mainline in the manifest of an ear or war.
    They have pretty strictly defined formats, and I don't want to risk violating a standard by tinkering outside the standard.Possible, but you can always run it as java -cp myWar.war my.utility.Version.
    There may be another possibility, but I'm unable to find any reference though:
    In my early Java days, I used to work on a system where there was a Unix utility (called something like +"ident"+) that was able to extract version and description info stuffed in a .so file (under which "standard" or proprietary format was the info stored, I don't know).
    I used to see it work on individual Java .class files too (from memory we had to put a String constant name "VERSION" in the class) and maybe jar files (I'm unsure).
    One of my co-workers at that time had described that as a standard tool, but "ident" turns up nothing of that kind on Google... And I've never since encountered any description of the "VERSION" constant naming convention...
    I was young and naive, I hope I were not bluffed by some alias in a custom setup... :o(
    Edited by: jduprez on Feb 18, 2010 11:30 AM
    OK a bit more reserah turned up [that man page|http://man-wiki.net/index.php/1:ident]. Apparently ident is part of RCS (installed along with CVS), and works by grepping the target file for patterns such as "$keyword: text $" (which is RCS/CVS keyword substitution pattern). Now that it mentions it, I remeber that that's what we put into our VERSION constant's value ("$version : ...$", or something of that kind).
    So:
    1) it's not so standard after all, you have to install the rcs package on the target host (regardless of whether you use RCS for configuration management, which would probably be a bad idea nowadays)
    2) you have to put such formatted strings somewhere in your code or configuration files (easy with Ant, if not genuinely through Subversion)
    3) To have it work on jar, war, ear, files, you have to make sure that the file is not compressed (otherwise the pattern might not appear in clear). I don't know whether that's easy to configure using Ant's jar, war, ear tasks.
    A bit of a hassle compared to stuffing your own utility class and using java -cp...

  • Deploying ColdFusion 8 project via EAR/WAR file

    I was wondering what considerations to take when deploying a ColdFusion 8 project as an EAR/WAR file. Is it possible to create the file on one computer (eg: development) and run it on another (eg: server)?

    ecalibur_lk wrote on 1/14/2010 11:47 PM:
    With ColdFusion packaged into the EAR, do you need ColdFusion installed on the environment you are deploying it on for it to work?
    No. You need to have a J2EE server like JBoss or JRun.
    If so, does it make a difference on what version of ColdFusion it is packaged with (eg: Developer vs. Enterprise edition)?
    If you want to We package our EAR files without a license key and
    leave it up to our clients to make sure they have the proper licenses
    for their environment. If they put a key in the properties file, we use
    the Admin API to register the instance. If they don't put a key in the
    properties file, the instance is a developer edition.
    Do you know of somewhere that describes how to build an EAR file via ANT and how to deploy it?
    http://www.adobe.com/devnet/coldfusion/articles/ear.html

  • New to EAR/WAR - where do files go?

     

    posting to servlet newsgroup.
              "Frank Rachel" <[email protected]> wrote in message
              news:[email protected]..
              > We've been successfully running under WebSphere 3.5 and Weblogic 5.1 for a
              > while. However, in this mode we are not using EAR/WAR files. Our login.jsp
              > page gets information from a properties file (in our case,
              > general.properties). Under the older versions, there was a "working
              > directory" concept, so thats where the property file needed to be. Where
              > does this go when I package everything up as a WAR?
              >
              > I have the WAR made, and it deploys. But when I go to the login.jsp (it
              > compiles) I get a filenotfound exception on my general.properties. Exactly
              > where is it looking for the file?
              >
              > Since our code it littered in a directory structure that doesn't match the
              > WAR structure, I manually create the war, so if I know where this goes
              > relative to the root of the WAR i can easily add it.
              >
              > Thanks.
              >
              >
              

  • Are JDev autogenerated paths needed to create ear, war and jar files ?

    Hi
    We want to create ear, war and jar files from Ant build script generated from JDeveloper 11.1.1.7.
    We also like to use ojdeploy with it.
    In the process of creating build.xml files from projects, we see these paths.
    We also have standalone Weblogic installed with ADF runtime 11.1.1.7
    Questions:
    1- Do we need these path ids to generate ear, jar, war files properly and then deploy the ear to our standalone Weblogic so that our webapp can run ok ?
    2- Why are they generated, if they are not needed
    From research, it appears that we don't need these paths except to keep ant targets of init, compile, exec etc with ojdeploy.
    3- Is that true ?
    We are afraid that because no paths are listed in the build.xml, then when we deploy the ear app, it cant use the ADF runtime on the standalone WLS.
    Thanks in advance for answering.
    Sincerely
    eg of paths generated below:
      <path id="library.SOA.Designtime"/>
      <path id="library.SOA.Runtime"/>
      <path id="library.BPEL.Runtime"/>
      <path id="library.Mediator.Runtime"/>
      <path id="library.MDS.Runtime">
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.mds_11.1.1/mdsrt.jar"/>
      </path>
      <path id="library.BC4J.Service.Runtime">
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.adf.model_11.1.1/adfbcsvc.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.adf.model_11.1.1/adfbcsvc-share.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/commonj.sdo_2.1.0.jar"/>
        <pathelement location="{oracle.middleware}/modules/org.eclipse.persistence_1.1.0.0_2-1.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.webservices_11.1.1/wsclient.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.web-common_11.1.1.jar"/>
      </path>
      <path id="library.TopLink">
        <pathelement location="{oracle.middleware}/modules/com.oracle.toplink_1.0.0.0_11-1-1-5-0.jar"/>
        <pathelement location="{oracle.middleware}/modules/org.eclipse.persistence_1.1.0.0_2-1.jar"/>
        <pathelement location="{oracle.middleware}/modules/com.bea.core.antlr.runtime_2.7.7.jar"/>
        <pathelement location="{oracle.middleware}/modules/javax.persistence_1.0.0.0_2-0-0.jar"/>
      </path>
      <path id="library.Oracle.Rules"/>
      <path id="classpath">
        <path refid="library.SOA.Designtime"/>
        <path refid="library.SOA.Runtime"/>
        <path refid="library.BPEL.Runtime"/>
        <path refid="library.Mediator.Runtime"/>
        <path refid="library.MDS.Runtime"/>
        <path refid="library.BC4J.Service.Runtime"/>
        <path refid="library.TopLink"/>
        <path refid="library.Oracle.Rules"/>
      </path>

    There are two different things here. Using ant to build the class files and then building an ear from the class files and other resources.
    The building part needs the libraries if you use javac as compiler. Building an ear file only needs the path to the jar files which are packed into the ear.
    In this sense you need the pages you see in the build.xml.
    Then Jdev offers another way: ojdeploy. This tool is a Jdev without a gui.
    You can use this tool and build the classes for each project of a workspace and to build build war and ear file. This is just like you click the rebuild button for each project and then the deploy the projects and application. If you use this approach you don't need the generated path ids as the whole build process is done inside Jdev as it's done on your developer pc.
    Timo

  • Need to deploy custom EAR/WAR on EBS OC4J

    hi all
    I'm using the VIS12 EBS image from Fusion Factory. I need to deploy a custom EAR/WAR on it. I have no EBS expertise (I'm a tech guy, not an apps guy).
    How do I do this deployment?
    I tried using admin_client.jar to use RMI for deployment but could not (admin_client either blocked, or the famous Cannot get Deployment Manager error)
    I also tried modifying the $OC4JHOME/j2ee/home/config/server.xml and use auto-deploy, then put my EAR in $OC4JHOME/j2ee/home/applications/
    This didn't work either.
    Also, I can't connect to ascontrol (port 7777/em or 7778/em give a 503 error). I am using the startall.sh script to start everything up.
    This is rather urgent, I need to deploy this EAR (AD4J agent) for a POC. Thanks.

    hi Hussein
    that note is specific to re-deploying forms.ear, however i need to deploy an arbitrary ear file..
    I was also able to use the note to re-deploy ascontrol, I also had to edit trusted.conf (in Apache/Apache...) to allow ascontrol Allow from all.
    Now I can access ascontrol at myhost:8000/ascontrol/
    I reset the password in system-jazn-data.xml and can verify that if I enter a wrong password, I get an error. However even with a correct password I get this error..
    An error occurred while making the JMX RMI connection
    and so I still cannot connect to AScontrol.

  • Replacing class file instead of redeploying whole WAR package

    Hi,
    This may sound very silly question, but I thought to post it just as to confirm.
    I have an application deployed in websphere ver 5. Usually when there are any changes to any class files, we rebuild the entire package, and then redeploy it using the admin console.
    Now, this time I've got only a couple of classes modified...my question is that can I just replace the modified classes directly instead of rebuilding the entire package and redeploying it?
    I'd assume that this is different from hot deployment, as I am prepared to start the server again if needed be. Please advise folks.
    Thanks

    The problem is that this particular class (servlet) can run only in production environment...there is no test environment to run it..but thanks...I did see IBM's take on this.
    http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/trun_app_hotupgrade_war.html
    I think it does answer the question, I can replace the .class file directly in the expanded version of the war package, and then restart the application. It should be picked up automatically.
    Thanks for your response.

  • JDeveloper 10g, ADF, ANT:How to define ant task for EAR & WAR file creation

    I am trying to automate the deployment process of our ADF Faces & BC application. I have reviewed this doc:
    http://download.oracle.com/docs/cd/B31017_01/web.1013/b28951/anttasks.htm
    and followed the procedure for integrating ant onto the server. I can build the project and also successfully deploy the ear file. Howerver, I did not find any instruction on how to generate the EAR file. Can anyone point me to the right place for this task definition?
    Here is my current build.xml file.
    <?xml version="1.0" encoding="windows-1252" ?>
    <!--Ant buildfile generated by Oracle JDeveloper-->
    <!--Generated Jul 16, 2007 12:20:13 PM-->
    <project name="CRDBApps" default="build-all" basedir="." xmlns:oracle="antlib:oracle">
    <property file="build.properties"/>
    <property file="ant-oracle.properties"/>
    <target name="clean-all" depends="">
    <ant antfile="build.xml" dir="CRDBView" target="clean"/>
    <ant antfile="build.xml" dir="CRDBLib" target="clean"/>
    <ant antfile="build.xml" dir="CRDBModel" target="clean"/>
    </target>
    <target name="build-all" depends="clean-all">
    <ant antfile="build.xml" dir="CRDBView" target="compile"/>
    <ant antfile="build.xml" dir="CRDBLib" target="compile"/>
    <ant antfile="build.xml" dir="CRDBModel" target="compile"/>
    </target>
    <target name="deployear" depends="">
    <echo message="-----> Deploying the application module deployment (ear) file"/>
    <oracle:deploy deployerUri="deployer:oc4j:opmn://myserver/home"
    userid="oc4jadmin"
    password="password"
    file="CRDBView/deploy/CRDBApps.ear"
    deploymentName="CRDBApps"
    bindAllWebApps="default-web-site"/>
    </target>
    </project>
    thanks!
    Wes

    Thanks all for the tips. After reading up a bit today on ear/war files and ant. I ended up just creating a task to mimic the ear/war file structure. My script isnt pretty but I'll work on refining that later. Here is what I have if anyone ever is interested:
    <target name="war" depends="">
    <echo message="Executing target war..."/>
    <mkdir dir="war"/>
    <copydir src="CRDBView\public_html" dest="war\"/>
    <copydir src="CRDBView\classes" dest="war\WEB-INF\classes"/>
    <copydir src="CRDBModel\classes" dest="war\WEB-INF\classes"/>
    <copydir src="CRDBLib\classes" dest="war\WEB-INF\classes"/>
    <echo message="Creating war file..."/>
    <jar basedir ="war" destfile="CRDBApps.war"/>
    <echo message="Done executing target war..."/>
    </target>
    <target name="ear" depends="war">
    <echo message="Executing target ear..."/>
    <mkdir dir="ear\META-INF"/>
    <copydir src="CRDBView\deploy\META-INF" dest="ear\META-INF"/>
    <copy file="CRDBApps.war" todir="ear\"/>
    <jar basedir ="ear" destfile="CRDBApps.ear"/>
    <echo message="Done executing target ear..."/>
    </target>
    <target name="cleanAndDeployCRDBApps" depends="build-all,deployear">
    <echo message="Executing target cleanAndDeployCRDBApps..."/>
    <delete dir="war"/>
    <delete dir="ear"/>
    <echo message="Done executing target cleanAndDeployCRDBApps..."/>
    </target>
    <target name="deployear" depends="ear">
    <echo message="Executing target deployear"/>
    <oracle:deploy deployerUri="deployer:oc4j:opmn://myserver:6003/home"
    userid="oc4jadmin"
    password="password"
    file="CRDBApps.ear"
    deploymentName="CRDBApps"
    bindAllWebApps="default-web-site"/>
    <delete file="CRDBApps.ear"/>
    <delete file="CRDBApps.war"/>
    <echo message="Done executing target deployear"/>
    </target>
    ...

  • Encrypt ear/war files

    hi
    my team is using oracle 10g Application srever[9.0.4] and jdeveloper..
    ear/war files are prepared for deployment.
    can i encrypt them while deploying them at custmers site for testing..
    regards
    avinash

    As far as I know this is not possible.

  • Extracted ear/war/jar file location in JBoss

    How can I find out in runtime where JBoss extracted my ear/war/jar file?
    I have a file inside my ear/war/jar file and I need to know the location of the file. I know that it is in the tmp/deploy directory but I need the exact application temporary name.

    You can take out the common classes and bundle them in a jar library that can be bundled directly in APP-INF/lib (or library directory defined by <library-directory> in applicaton.xml if you are using JEE5 / WLS 10). Is it possible to do this re-arragement?

  • EAR/WAR File Deployment Query on WEBLOGIC SERVER

    Hi,
    We are running weblogic server version 10.3.4.0 where EAR/ WAR files deployed on single server and that has been configured in the current WebLogic Server domain. These applications are up and running fine. We need to deploy a new WAR file on the same domain. My questions are:
    @ Whether I can deploy new WAR file without STARTing and STOPing weblogic server instance?
    @ When deploying new WAR file, whether it will affect existing deployed files or will it affect any other running services for a fraction of second?
    Note: This new WAR file is independent application and will not affect any other services in the future.
    Please assist.
    Thanks,
    Dheeraj

    Thank you for your help but the result is still the same.
    I deployed the library on weblogic server suggested by you.
    File Deployed as library = oracle.adf.desktopintegration.model.ear
    From the folder = C:\Oracle\Middleware\oracle_common\modules\oracle.adf.desktopintegration.model_11.1.1
    It is active.
    After this I loaded jdeveloper and deploy the same sample application and found that the result is same.
    Pls let me know where I am going wrong.
    Regards,
    Masood
    [11:53:09 AM] ---- Deployment started. ----
    [11:53:09 AM] Target platform is (Weblogic 10.3).
    [11:53:09 AM] Retrieving existing application information
    [11:53:09 AM] Running dependency analysis...
    [11:53:09 AM] Building...
    [11:53:09 AM] Deploying 2 profiles...
    [11:53:09 AM] Wrote Web Application Module to C:\JDeveloper\mywork\10MinDemo\ViewController\deploy\10MinDemo_ViewController_webapp.war
    [11:53:10 AM] Wrote Enterprise Application Module to C:\JDeveloper\mywork\10MinDemo\deploy\10MinDemo_Project1_10MinDemo.ear
    [11:53:10 AM] Deploying Application...
    [11:53:10 AM] [Deployer:149191]Operation 'deploy' on application '10MinDemo_Project1_10MinDemo' is initializing on 'ADFServer'
    [11:53:11 AM] [Deployer:149193]Operation 'deploy' on application '10MinDemo_Project1_10MinDemo' has failed on 'ADFServer'
    [11:53:11 AM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application 10MinDemo_Project1_10MinDemo on ADFServer.: .
    [11:53:11 AM] Weblogic Server Exception: weblogic.management.DeploymentException:
    [11:53:11 AM] Caused by: java.lang.ClassNotFoundException: oracle.adf.share.weblogic.listeners.ADFApplicationLifecycleListener
    [11:53:11 AM] See server logs or server console for more details.
    [11:53:11 AM] weblogic.management.DeploymentException:
    [11:53:11 AM] Deployment cancelled.
    [11:53:11 AM] ---- Deployment incomplete ----.
    [11:53:11 AM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)

  • Eclipse JSP .war package

    Hi,
    I have developed a JSP app, which uses a couple of external jars. While developing this app, I simply copied the external jars into the shared/lib directory of Tomcat.
    Now I want to package and distribute this app as a .war file, as Eclipse has an easy utility for creating the .war file.
    Is there an way of including the external jar files with my .war package, or do i have to tell each user to copy the external jars into the shared/lib directory of Tomcat???
    Thanks in advance,
    Aidan

    U need MyEclipse plugin for eclipse for J2EE projects which is available at
    http://www.myeclipseide.com/
    You can create a war file aswell using ANT build scripts...I dont have that at the moment

  • How to structure a JSF application (EAR/WAR/JAR)

    Hi All,
    How do you recommend I should structure a JSF application in terms of EARs, WARs and JARs?
    Let me set the context for you: I have a fairly large project which consists of a number of sub components. Each of these sub components are JSF applications in the sense that they have JSF pages connected to each other. So, for instance, I have a company management sub component and a product management subcomponent. Most of these sub components share some Java libraries and/or entities.
    Because of this I decided to have each sub component contained in its own WAR, with no universal libraries in its lib folder, and to then add these WARs to an EAR with all the library JARs in the EAR's lib folder, as so:
    EAR
       |_ component1.WAR
       |_ component2.WAR
       |_ lib
             |_ sharedlib1.JAR
             |_ sharedlib2.JARUnfortunately I'm having more problems than I hoped I would with JSF with this setup. An alternative I have is to create one gigantic WAR which contains all the library archives and then to only deploy this WAR. Although this would probably work, it destroys the nice seperation I had between sub components, where I could for instance just remove the one WAR from the EAR if it was giving problems. That structure would look something like this:
    WAR
       |_ <WebContent>
       |_ WEB-INF
                 |_ classes
                           |_ <JSF classes>
                 |_ lib
                        |_ sharedlib1.JAR
                        |_ sharedlib2.JARFinally, I have a third option where I add all the libraries required by a WAR to its lib folder and I have no shared libraries in the EAR's lib folder. The disadvantages are of course that the EAR will be huge as JARs get duplicated unnecessarily, and I'm not sure that this won't cause conflicts. The structure would look like this:
    EAR
       |_ component1.WAR
                        |_ WEB-INF
                                  |_ lib
                                        |_ sharedlib1.JAR
                                        |_ sharedlib2.JAR
       |_ component2.WAR
                        |_ WEB-INF
                                  |_ lib
                                        |_ sharedlib1.JAR
                                        |_ sharedlib2.JARI believe the first way to be the best, but I'm struggling getting JSF to work like I expect (see [http://forum.java.sun.com/thread.jspa?threadID=5288069|http://forum.java.sun.com/thread.jspa?threadID=5288069] ). What are your suggestions?
    Thank you,
    Ristretto

    Dear hiwa,
    thank you very much for your response. I have had a look into the book and found out that it provides indeed half of the solution i need. Now I can generate a JSF response to my non-JSF request which has been issued by the main application.
    Unfortunately this is only the first half of the solution, because the JSF framework of the child application will still render URIs into HTML-forms (e.g. for the <f:view>) that point to the faces servlet and not to the non-JSF servlet of the main application.
    I'll try to solve this problem by providing my own ViewHandler that provides other URIs. But I still don't know how to encode the view ID into the generated HTML-form as a hidden field.
    After all, I am really surprised at how difficult it is to integrate the JSF framework into a non-JSF application. I don't think this is a very uncommon scenario. In my case, we integrate into an existing large application of our customer in order to extend his application with our product. I would expect this to work out of the box with JSF (sigh).
    I will post my progress in this matter if I found some interesting solution.
    Bye, Marcus

Maybe you are looking for