JAR,WAR,EAR...

HI,
EJB modules are packaged as JAR files with a .jar extension.
Web modules, are packaged as WAR file (though it can be .jar )
Why we need to make it as .war file ?We can do it as .jar ?
But anyway why at time of delivry we create a EAR file ?what are the significance of making file differently ? Is it not posssible to make everything .jar and deliver it.

EJB modules are packaged as JAR files with a .jar
extension.
Web modules, are packaged as WAR file (though it can
be .jar )
Why we need to make it as .war file ?We can do it as
.jar ?To tell the servlet container what to do with it. It has to extract the WARs after all. I don't think it'd extract a JAR file if it were in te deployment directory.
Also keep in mind that WAR have additional content, like the Web.xml.
But anyway why at time of delivry we create a EAR
file ?Because it can contain more than just WARs. It also contains deployment modules for application servers.
what are the significance of making file
differently ? Is it not posssible to make everything
.jar and deliver it.Why do you care whether it's called .jar or .ear? Especially since there's a clear semantic difference, even if they all are just ZIP files.

Similar Messages

  • Versioning JAR/WAR/EAR and CLASS files

    Does anyone know of a standard, defined and recommended way of versioning JAR/WAR/EAR files?
    I guess I can put version information in the Manifest.mf file, but is there a recommended way?
    Another related question is how do I go about versioning individual class files?

    There's not only a recommended way, but a standard way. See http://java.sun.com/products/jdk/1.2/docs/guide/versioning/spec/VersioningSpecification.html#PackageVersioning).
    However, I've found that this practice is unfortunately not as widespread as one would like. sigh
    What do you mean by "versioning" individual class files (in a JAR, I assume you mean)? In general that's a bad idea. But perhaps I misunderstand what you mean.

  • Deploying servlets (not in jar/war/ear!) to OC4J?

    I must be missing some very tiny but crucial issue....
    For over 2 days now (shame) I have been trying but not
    succeeding to deploy servlets to OC4J behind Apache. The 'behind
    Apache'-part is easy. Just set up a proxy. This is because
    Apache configuration is easy and well documented. But here is my
    real problem. I am using JDev 3.2 (9i too large) and this is
    what I want:
    I want to code a servlet in Jdeveloper, compile it to a class-
    file, not a jar, war, ear or whatever-r. Then I want to set up
    OC4J in such a way that I can access my servlets from the
    directory where the class files are. I do NOT want to use the
    default-web-app subdirectory for obvious reasons. Please, how do
    I set up OC4J to just look in my own classes-directory with my
    own servlets???? No jar, no war, no ear.
    I have been reading all sorts of information on this and tried
    everything, but am not succeeding and getting all sorts of
    error/not found messages.
    Extra info:
    I am using OC4J on windows. To start I use java -jar orion.jar,
    to restart I use ^C and repeat the start command. Is that ok or
    do I need to restart in a different way? I tried to setup OC4J
    as a service but the link to runexecsvc went astray to judosoft
    Any help will be greatly appreciated!

    Avi,
    Thanks for your swift reply. I have indeed read the docs, but
    the exploded directory format does not seem to work for one
    reason or another (got some error messages on file not found or
    something). Have you succeeded in deployment using exploded
    directories? If so, I would be greatly interested in your xml-
    files and directory structure!
    But, please do not spend too much time on this, because I have
    now decided that I will deploy using a war. I have written a
    small script to make a war out of my whole project and copy it
    to de OC4J file system. This works and everybody is happy.
    Thanks again,
    Martijn

  • How to Create a jar war or ear--Probelms in deploying

    I have the following dir structure. I am using Struts 1.1 and weblogic 7.0
    APP
    +jsp
    +WEB-INF
    + ---lib
    +--- classes
    +----com
    --ap
    --action
    --beans
    --handler
    --service
    --client
    --ejb
    --valueobject
    1> Do I need to create a ear file since i want both the ejb (under service folder) and war as reusable components. Whenever we have a EJB component do we always need to have an EAR file??
    2> Whats the best way to create the jar, war or ear file. I am facing great difficulty in deploying the war.Do we need to set any classpath before we create the war and jar files except for the deployment descriptors.I have created the ejb descriptors correctly through ejbc.
    3>I have kept struts.jar,log4j.jar under lib folder. However when i create the ear and try to deploy it under weblogic it deploys the war file but gives error in deploying the jar which has the ejb. I have aslo validated the jar using ejbc.
    It gives error indicating that it requires struts.jar in classpath. If we give the classpath of struts.jar at system leve the Application deploys with ease..Can anyone tell whats the error.The jar does not use any strust component .
    4>Also the valueobject which has some beans which are used to populate the jsp through Actionformbean. Is it ok if we give refrences in both ejb jar and war?
    ie while creating jar and war folder have the valueobject in both the files or will it lead to any errors..
    Thanks in Advance
    ....

    Yes, I have tried that. But, as the server is running and the jars are in use, it throws and EditFailedException

  • Jar, War or Ear file ?

    Hi,
    I am a total newbie in J2EE technology.
    I am currently using Sun One Application. Using the sample application, it produces all the Jar, War and Ear files.
    My understanding is Jar is produced to be a library-like usage.
    War is for web application.
    And Ear is for what?? oops EJB? Can someone tell me?
    Anyway, my concern is, if I am to produce Ear, war, or Jar file after deploy, I have problems doing the testing. Let's say I want to modify the Jsp file, then I have to use ant to compile all, undeploy the instance and deploy again.
    Any better way?

    your jar files contain your EJBs, your WAR file contains your web application (JSPs, servlets and support) and these are all bundled into your EAR file. All of these files are just zip-formatted archives, you can look at them all via the jar tool (or something like WinZip, if you are so inclined). Each of these will contain a descriptor file (in XML format) - check out the J2EE spec on it.
    Lee

  • Difference between .jar, .war and .ear file

    Hi,
    I am pretty new to J2EE technology.
    I would like to know what is the difference between .jar, .war and .ear files and how they are deployed on webserver.
    Thanks,

    Files with a .jar extension or JAR files, are essentially just a collection of files compressed using the ZIP/ZLIB compression format.
    JAR (short for Java Archive) files were introduced in the early days of Java as a means to conveniently package and distribute Java applications and components. Since then, a number of additions to the Java platform have followed suit. The introduction of the EAR file is one such addition.
    An EAR (Enterprise Archive) file is a JAR file that contains a J2EE application.
    A J2EE application is a group of Web modules that collectively perform as a single entity.
    A Web Module is an entity consisting of one or more resources such as HTML files, Java class files, XML files, etc. Web Modules are packaged in Web Archive (WAR) files.
    Looking at it from a top-down view, EAR files contain JAR files and WAR files. Packaging resources in WAR files, JAR files and eventually EAR files, makes it easy to reuse and reassemble components as new J2EE applications and distribute them to new environments.
    For example, Tomcat deals only with WAR files.
    So, in order to auto-deploy a Web application to a Tomcat environment, you must place an application's WAR file in the appropriate directory or use Tomcat's deployment tools to manually deploy the file.
    If you already have an EAR file that contains the WAR file, you can extract the WAR file and use it as is. If you do not have the EAR file or the WAR file, you can use any number of compliant tools to create the WAR file. Tomcat is a servlet/JSP container available from the jakarta.apache.org site.

  • Jar signing may be applied to WAR/EAR files?

    Greetings,
    I wonder if the WAR/EAR files (J2EE related) can be also affected by signing it. I mean, when a signed jar file is updated with class, the JVM will throw an error about the signature of that class doesn't match the class file.
    Now, since a WAR/EAR file is a JAR file but with JAR files instead classes files, I wonder if signing a WAR/EAR file and if someone update it without signing, the application server (e.g., tomcat) will verify the signature?
    If true, that would be just great since I may have resources (JSP files and similar stuff) that would be just great if I could verify its integrity.
    thanks,
    Pedro Salazar.

    Indeed, but I was referring to remove the signature block and also the digests in the manifest file, - a clean (unsigned) jar file :-)
    Now, I have question for you:
    Is it possible to compel that a jar must be signed by a specific entity (certificate) to be validated? For instance, anyone could repack the jar in a clean jar file, and the system wouldn't care about that. So, I would like to say that the jar file to be validade must be signed by a specific entity. Is there any policy to say for a specific jar file? The problem here could be how to refer that to the jar file since it would be deployed in a application server...
    Maybe I should open a new thread about this, but you may also clarify me this shortly...
    regards,
    Pedro salazar.

  • Dofference bw WAR vs JAR vs EAR

    Can any one tell me the diff bw EAR,WAR,JAR

    Can any one tell me the diff bw EAR,WAR,JAR
    WAR: War is a state of widespread conflict between states, organisations, or relatively large groups of people.
    JAR: A cylindrical glass or earthenware container with a large mouth and capable of holding liquids, usually without handles.
    EAR: An ear is an organ used to detect sound.

  • Replication of utility/helper classes in JAR/WAR.

    Hello folks,
    I have recently learned the class loader hierarchy that is employed in
    the WebLogic server. Previously, I was including the local component
    interfaces of my EJBs in the EJB JAR file as well as the web
    application WAR file. However, since the EJB class loader is the
    superclass of the WAR class loaders, the WAR class loader can see all
    classes in its level as well as the level above it (the EJB class
    loader and system class loader). Therefore, I removed the Local
    component interfaces from the WAR file, and the system works fine.
    However, I have various utility/helper classes that are in the EJB JAR
    file as well as the WAR file. Is it safe to remove them from the WAR
    file? Is there any need to duplicate classes in the JAR/WAR file if
    they are packaged together as an EAR file? Any input is highly
    appreciated.
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669

    No, your helper classes will also be visible to the war class loader.
    You might also consider packaging your helper classes in a separate jar
    file. Then add a manifest class-path entry in your ejb.jar and your
    web.war that references the utility jar file(s). This should work on
    any J2EE server.
    -- Rob
    Ryan LeCompte wrote:
    Hello folks,
    I have recently learned the class loader hierarchy that is employed in
    the WebLogic server. Previously, I was including the local component
    interfaces of my EJBs in the EJB JAR file as well as the web
    application WAR file. However, since the EJB class loader is the
    superclass of the WAR class loaders, the WAR class loader can see all
    classes in its level as well as the level above it (the EJB class
    loader and system class loader). Therefore, I removed the Local
    component interfaces from the WAR file, and the system works fine.
    However, I have various utility/helper classes that are in the EJB JAR
    file as well as the WAR file. Is it safe to remove them from the WAR
    file? Is there any need to duplicate classes in the JAR/WAR file if
    they are packaged together as an EAR file? Any input is highly
    appreciated.
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669

  • 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

  • What is the diffrence b/w jar and ear?

    what is the diffrence b/w jar and ear?

    Refer this
    http://forum.java.sun.com/thread.jspa?threadID=779900&tstart=0
    Regards
    lekshmi

  • Trying to understand servlet jar/war interaction

    I am working on an integration project.
    I have a war file that has many of the components that I need.
    In my new project (Sun Studio IDE), I am trying to call up a servlet that exists in this other war file.
    I can mount the war file as a directory, just like mounting a jar for use like classes12.zip whatever or similar to including a jar in your classpath.
    Can I call a servlet in another jar, war, or zip file from my existing code?
    How will the existing code or jsp know where to find this servlet outside the project?
    Usually you have to either map the servlet or set this info in the web.xml, I think.

    I am working on an integration project.
    I have a war file that has many of the components that I need.
    In my new project (Sun Studio IDE), I am trying to call up a servlet that exists in this other war file.
    I can mount the war file as a directory, just like mounting a jar for use like classes12.zip whatever or similar to including a jar in your classpath.
    Can I call a servlet in another jar, war, or zip file from my existing code?
    How will the existing code or jsp know where to find this servlet outside the project?
    Usually you have to either map the servlet or set this info in the web.xml, I think.

  • Deploying one app in multiple jars / wars

    Is it possible to split up an application into two or more jars / wars,
              and still be deployed as a single application. Our requirment is such
              that we need to do that, but I can't seem to find a way to make it work.
              Thanks Shehzad
              

    john,
    The doc instructs to download oracle fusion middleware 11g, which is around 1gb, by this it becomes a heavy application.
    Is there no work-around to get only the necessary components viz ADF runtime libraries to be used in WAS 7.0 to get the app deployed?
    I am little tangled here.... Pls help me to know the structure...
    Thank you.
    Edited by: hemanth on Jul 13, 2011 9:54 AM

  • Using JMX to read ejb manifest jar and ejb-jar.xml in ejb jar inside ear

    Hello,
    I have an ear deployed on weblogic console. I need to check contents of manifest file and ejb-jar.xml of a jar that is present in the deployed ear.
    Currently I am using below code to access jar inside ear deployed :
    Hashtable env = new Hashtable(5);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL,
    url);
    env.put(Context.SECURITY_PRINCIPAL, user);
    env.put(Context.SECURITY_CREDENTIALS, password);
    Context ctx = new InitialContext(env);
    mBeanHome = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    String type = "EJBComponentRuntime";
    Set beans = mBeanHome.getMBeansByType(type);
    try{
    for(Iterator it=beans.iterator();it.hasNext();)
    EJBComponentRuntimeMBean rt = (EJBComponentRuntimeMBean)it.next();
    if(rt.getParent().getName().equals("xxx")){
    System.out.println(rt.getName());
    l.add(rt.getName());
    Here xxx is the ear. Now I need to get inside the jar (represented) by variable rt and access its manifest file,ejb-jar.xml
    Does anyone have an idea how to do this?
    regards
    Sameer

    Isn't it possible to put them there manually? :)

  • Unable to find ejb-jar with uri X.jar in ear at c:/Y/split_src

    Stack trace is below, but the ejb does exist at the location that the FileNotFoundException states. I've checked that application.xml, org.eclipse.wst.common.component both have the correct name for this dependency.
    java.lang.Exception: Exception received from deployment driver. See Error Log view for more detail.
      at oracle.eclipse.tools.weblogic.server.internal.DeploymentProgressListener.watch(DeploymentProgressListener.java:190)
      at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.deploy(WlsJ2EEDeploymentHelper.java:506)
      at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishWeblogicModules(WeblogicServerBehaviour.java:1466)
      at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:898)
      at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishOnce(WeblogicServerBehaviour.java:686)
      at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publish(WeblogicServerBehaviour.java:539)
      at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
      at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3153)
      at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
    Caused by: weblogic.application.ModuleException:
      at weblogic.ejb.container.deployer.EJBModule.init(EJBModule.java:334)
      at weblogic.application.internal.flow.ModuleListenerInvoker.init(ModuleListenerInvoker.java:167)
      at weblogic.application.internal.flow.InitModulesFlow.initModule(InitModulesFlow.java:312)
      at weblogic.application.internal.flow.InitModulesFlow.initModules(InitModulesFlow.java:325)
      at weblogic.application.internal.flow.InitModulesFlow.prepare(InitModulesFlow.java:378)
      at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
      at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
      at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:59)
      at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:208)
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
      at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
      at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
      at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Caused by: java.io.FileNotFoundException: Unable to find ejb-jar with uri ***.jar in ear at C:\***\split_src
      at weblogic.ejb.spi.EJBJar.<init>(EJBJar.java:81)
      at weblogic.ejb.container.deployer.EJBModule.buildClassFinder(EJBModule.java:201)
      at weblogic.ejb.container.deployer.EJBModule.init(EJBModule.java:313)

    Hi Ten,
    FYI, just by placing the ejb jar inside EAR project it will not be picked up for deployment. The EJB module has to be defined on EAR Module Assembly, and the steps are:
    > EAR Project | Properties, Deployment Assembly - Add EJB module
    NOTE: To verify the dependency you could try to export the EAR project to an .ear file. If the exported .ear file bundles ejb jar then deployment should work fine.
    As far as the deployment mode, OEPE supports WebLogic Split-source (default) and Exploded archive. In the default split-source mode, the .beabuild.txt contains the mapping to the actual files whereas in exploded archive the files are copied over to deployment staging location.
    Steps to modify deployment mode:
    > In the server view, right click on server configuration | Properties, select WebLogic | Publishing
    Please make sure the ejb module is defined appropriately and let me know if this resolves the issue.
    Thanks,
    Ram

Maybe you are looking for

  • Can I move Array from one Xserve RAID to another and keep the data

    I'd like to move a set of disk with an existing Array from one Xserve RAID to another. Can I simply shutdown both Xserve RAIDs and move the disk over, assuming I put the disk back in the same order?

  • I had family with one iTunes account

    how do i migrate to icloud?  do i need to create an account for each family member?  will i still be able to share apps with my wife?

  • Mac Pro 2009 - To keep or not to keep? Only running windows

    Well, with values of older Mac Pro's going down, i'm now unsure what I should do. In total I have 3 Mac Pro's. 1 for work at my father's house (2009, 2.26 8 core), 1 there for Testing and Guests (2006 2GHz dual core). My third one, however, I keep he

  • How to read kernel panic, pls?

    Hello guys, how does one read kernel panic, please? This is what I got and I'm not sure what to get out of it. I haven't had one for at least 3 years. Anonymous UUID:       BF7B1BB7-02DD-007D-A01A-51C381BB818E Thu Mar  6 23:27:01 2014 panic(cpu 2 cal

  • Note 951952 - Incorrect excise values if batch split in MIGO for import PO

    Dear participants, We have applied Note 951952 - Incorrect excise values if batch split in MIGO for import PO, for following issue, While doing import goods receipt for batch split quantity, excise base value is calculating for entire amount not by s