War file and deployment

Hi,
im new to j2ee and there are some qns i hope you can help me with.
1. why is there a need to put my jsp and servlets in a .war file?
2. where do i do my placements of ejb and jsp into the respective jar and war files? in my web server?
thanks a lot!

1. why is there a need to put my jsp and servlets in a .war file?Answer- As technology evolved over ther period of time, it became more and more evident that the smaller and easier the things the better it is. WAR format is a ZIP format created to deploy your web application data. Hence called WAR(Web Application Archive). It usually contains your Images, JSP pages, and servlets and other related helper files needed by your web application. Java being a cross platform technology, it becomes easy and standardized to distribute your application(web) to other vendors/teams/people if one makes use of a WAR file. Once dropped in the root directory of the App server(i mean the proper webapp directory) the application server is smart enuf to load your WAR file and create respective directory structure.
2. where do i do my placements of ejb and jsp into the respective jar and war files? in my web server?Answer:- When you add the EJB files and distribute it along with your WAR file, its called EAR(Enterprise Archive) which is WAR+ EJB jar files. As for the JSP's they form a part of the WAR and should be bundled up while creating the WAR file.
Hope this answers the question.

Similar Messages

  • War Files And Their Deployment and Redeployment

    Howdy
    I have a WAR file that a developer gave me which I deployed on a Linux box no problem.
    Now I would like to add a jsp file and custom tag to this application.
    This is what I tried:
    I turned the war file into a zip file extracted the contents and then added my jsp page the class file for the custom tag modified the web.xml file for the tag and added a tld file for the tag as well.
    Then I rezipped the files and renamed to a .war file and deployed it on the linux box. The previous existing files work but my new jsp page comes up with a HTTP 404 Not Found error.
    Now the new jsp and custom tag work on my development machine just not on the live server when reployed into the other existing app.
    What am I missing? Or am I totally off with trying to redeploy the app in this way?
    Any help appreciated.
    Adam

    For deployment you need to use ant

  • Hi,Can a WAR file be deployed as EAR file and vice versa.

    Hi,Can a WAR file be deployed as EAR file and vice versa.If so what are the changes we need to do.

    hi tel me in detail why u want 2 do that
    why u want to cnvert a web arch into enterp arch

  • Porting *.war files and *.ear files to Weblogic 10.3

    If we can figure this issue out, I'll see if I can't publish/post a
    maven-based solution in the Maven and Oracle forums so that others
    will not have to go through our pain.
    We are having all the usual problems regarding where Weblogic expects
    to find things and what exclusions need to be made in weblogic.xml for
    war files and weblogic-application.xml for ear files. Any insights
    would be deeply appreciated.
    Here is what our exploded war structure currently looks like.
    |____index.jsp
    |____WEB-INF
    | |____lib
    | | |____...a long list of jar files
    | |____tags
    | | |____...a short list of tag files
    | |____applicationContext.xml
    | |____web.xml
    | |____content
    | | |____...a bunch of jsps
    | |____tlds
    | | |____...some tlds
    | |____classes
    | | |____mailProperties.properties
    | | |____struts.xml
    | | |____logback.xml
    | | |____com ... the root of our class heiarchy
    |____images
    | |____...a list of images
    |____META-INF
    | |____maven
    | | |____com
    | | | |____project-name
    | | | | |____pom.xml
    | | | | |____pom.properties
    | |____MANIFEST.MF
    |____script
    | |____...some java script files
    |____style
    | |____...some css files
    Exceptions when trying to deploy are as follows:
    INFO: ... initialized Struts-Spring integration successfully
    java.lang.Exception: Could not load
    servers/AdminServer/tmp//appmergegen_1254502686535_OurApp/war/WEB-INF/classes/com...
    at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:745)
    at com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:148)
    The exception above repeats for every .class file found below
    WEB-INF/classes/com, i.e. the the ones in this module rather than the
    ones in included modules.
    Checking the file system shows that there is no such directory as
    "appmergegen_1254502686535_conap". I'm uncertain if there is actually
    supposed to be anything there, but it would seem like it.
    I've a theory that if we can solve the above issue, we can solve the
    rest ourselves.
    It would also be handy to know what packages may cause conflicts.

    Alright, my research points to the idea that this might have something to do with staging. Since this is a dev setup we don't have any managed servers or anything. All we have is AdminServer and that is it. We have only one domain and it is "base_domain". Does anyone know if this is wrong?

  • Extract WAR file while deploying

    hi
    Is there any way or option which we need to give in deployment descripter to
    extract the war file while deploying.
    Any one can suggest me how to proceed in this aspact.
    Thanks and Regards
    Anand Mohan

    Anand,
    Can you give a context for this question? Are you packaging your J2EE modules
    into an ear file and need to extract the war file? What is the use case for
    the scenario you are describing?
    Chuck Nelson
    DRE
    BEA Technical Support

  • Difference between .war file and .ear file

    Hi,
    what is the difference between .war file and .ear file ?
    Please let me know with appropriate explanation.

    War file means web application archive. It is archived file having a collection of JSP, servlets and static pages that together costitute a web application. It contains one WEB-INF directory which will have a file named web.xml which defines the structure of the web application.
    On the other side EAR file is Enterprise application archive. It is file having packaged content of one or more modules into a single archive so that the deployment of all the modules can be done simultaneously on the application server. It also contains XML files called deployment descriptors which gives the details of the deployment method. This deployment descriptor will be present in the folder META-INF folder.
    So the main difference betwwen the two is that Ear file is having collection of various modules to be deployed on the application server while the WAR file is used to deploy the web applications.

  • Behaviour differences between  war file and exploded directory

    Hi,
    I'm baffled by differences in how my web app behaves when deploy in a war file and when deployed in exploded directory.
    Firstly when I deploy in exploded directory format (using wldeploy in ant) - the jsps do not precompile. However, when I deploy the war file - again using ant and wldeploy - precompile works just fine - and general performance seems better.
    Secondly - the webapp has a pdf file - which is used as a template to dynamically produce a document. When deployed
    in exploded format - the webapp works fine and is able to read the pdf. However, when I deploy in war file, the pdf cannot be read.
    Surely the behaviour should be the same whether we deploy as a war or exploded.
    Someone please help
    Tariq

    Some behaviors will be different between a WAR file deployment and an exploded WAR deployment.
    With respect to JSP precompile, you just say "they do not precompile", so I can't tell anything about that.
    When you read files from an exploded WAR, you can reference them in two ways: as a resource, or as an absolute file path. When you read files from a WAR file, you can only read files as a resource, and not as an absolute file path. You're not giving any information about how you're reading the file, so I can't tell about that either.
    You'd have to provide more detail to get better answers.

  • Creating ear and war file from deploy file programatically

    Hi All,
    Is there any API available in oc4j to create an ear or war file from a .deploy file...........??
    Thanx in advance.

    There isn't a public API that let's you hook up to the deploy file in JDeveloper.
    You might be able to achieve this with the JDeveloper Ant task:
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/anttasks/index.html

  • War files and configuration files

    Hi,
    I'm trying to deploy servlets using a WAR file. Everything works fine except I can't read the configuration files from the servlet code.
    The code reading the configuration file is as follows:
    input = ClassLoader.getSystemResourceAsStream("test.properties");
    properties.load(input);
    Of course this code assumes that the file "test.properties" is in the class path.
    Where should I put the property file in the WAR file so that it is in the class path?
    If this can�t be done, how should I structure my code around this problem?
    I�m using Tomcat 3.2�
    Thank you very much

    I haven't had any trouble accessing properties files in the WEB-INF\classes using the following...
    public class MyAnchor
         private static Properties properties = new Properties();
         static
              URL url = MyAnchor.class.getResource("mywebapp.properties");
              try
              properties.load(url.openStream());
              catch(Exception e)
              e.printStackTrace();
    public static final String PROP_CONSTANT_1 = properties.getProperty("prop_constant_1");
    But I have now run into problems when trying to create a WAR file with the J2EE Deploy Tool, which will only allow *.class files to sit in the WEB-INF\classes directory.
    I'll be really annoyed if I have to change the properties file name to mywebapp.class just to get around this problem.
    Has anyone else found this?? I know I can add the *.props manually, but again would prefer not to.
    I'm hoping its only a J2EE problem and deploying to other servers will not have this requirement.

  • Problem redeploying war files with deployment tool

    I'm going thru the j2ee tutorial(downloaded Dec 03). I can't successfully redeploy war files. After making changes to a java file and then rebuilding using asant, using the deploytool I save changes and then redeploy. I always get the old version unless I completely remove the old web module and create a new one. I've seen this problem over and over in the forum but nobody has addressed it properly. Please help.

    To be more specific, I'm working on the bookstore example in the J2ee tutorial. If I just add a single web module(banner servlet) to the existing standalone war module bookstore1, The tools->update module tools->deploy works fine. If I add the rest of the modules(bookDetailsServlet,bookStoreServlet,etc). After making changes and rebuilding the .java files if I go to tools->update module the window displays nothing under the heading "the following entries have changes".
    Under the heading "the following entries were not found on disk" is a list of all the files under the war module bookstore1.war. I'm don't understand why it is not recognizing the changes. Any help would be appreciated.

  • Wl6.1, war files and 2 letter jar files....

    Hi,I have finally found why my WAR file isn't loading with weblogic 6.1. It seems that it doesn't like two letter class libraries (eg ab.jar) and will through a vague error message at deployment (Prefix string too short). I don't know what has changed between 6.0.2 and 6.1 in this area, but its worth making it apparent to developers in general.Regards,Mark BarryHewlett-Packard Consulting

    Are you saying that this error doesn't occur in 6.0?
    I think i knew what's the problem is, but it would be helpful if you could post the stack trace?
    Mark Barry wrote:
    Hi,I have finally found why my WAR file isn't loading with weblogic 6.1. It seems that it doesn't like two letter class libraries (eg ab.jar) and will through a vague error message at deployment (Prefix string too short). I don't know what has changed between 6.0.2 and 6.1 in this area, but its worth making it apparent to developers in general.Regards,Mark BarryHewlett-Packard Consulting

  • How to go from a .wsdl to .war file to deploy on Tomcat ? (using jax-rpc?)

    I have created a .wsdl file using XMLSpy and I want to deploy the service on tomcat. I have been unsuccessful in using the "wscompile -import" option.
    Does anyone know how to cross-compile a .wsdl file into a .war so it can be deployed on tomcat? If there is another way other than a .war file, that is fine too...
    Currently, I am using WSDL2Java tool by Apache Axis. I take my .wsdl file use the WSDL2Java tool to get the java files, Then I run the java files through wscompile, wsdeploy etc.... the problem with this approach is that the .wsdl file produced by the wsdeploy does not support the document encoding (everything switched to rpc) and no literal either (I think).
    If anyone has figured out a better way of going from .wsdl to java or .war or tomcat.. please let me know.. I'm running out of options...
    Thank you !

    The link worked correctly for me. You can also refer to a recently published whitepaper at
    https://jax-rpc.dev.java.net/whitepaper/1.1/index-part1.html. Scenario 5 in second part (https://jax-rpc.dev.java.net/whitepaper/1.1/index-part2.html#Scenario5) of the whitepaper describes how to achieve your scenario.
    Post your JAX-RPC related questions to [email protected] for a quicker resolution.
    Send an email to [email protected] to subscribe to the alias.
    Send an mail to [email protected] for a complete list of help commands.
    Thanks for your interest in JAX-RPC.
    Regards,
    -Arun

  • WAR file and necessary Tomcat settings

    Hello all,
    These are some basic questions i came across while deploying web application.
    I think, servlet being very basic for j2ee, it should be thouroghly dealt with.
    1. What is developer's role with respect to WAR file? Is it created autometically by Tomcat or developer has to create it and how?
    2. If i have to deploy a web application in Tomcat container, which are different essential settings i need to make in different config files such as server.xml, web.xml? Eg. time-out in wb.xml.
    3. What are server.xml & web.xml? is it a part of servlet specifications?
    I know you might find these very abcd.
    Thanks in advance.

    I'm using iPlanet Webserver but I've been working with these files so some of the stuff I know may help you.
    1. What is developer's role with respect to WAR file?
    Is it created autometically by Tomcat or developer
    has to create it and how?I think it's mostly a developer thing (not knowing much about Tomcat). Creating WAR files is quite simple - have a look here:
    http://access1.sun.com/techarticles/simple.WAR.html
    3. What are server.xml & web.xml? is it a part ofservlet specifications?Web.xml contains information about the servlets in the webapp. Server.xml contains a line which tells the server where the webapp has been deployed to.
    The following document is useful from an iPlanet point of view and may give you some more answers:
    http://docs.sun.com/db/doc/817-1833-10
    Hope this helps a little :)

  • War file and new Trusted attributes since SE 6 update 19

    We deploy a war file which provides multiple applets. The new mixed code warning dialog is being displayed multiple times per user session (whenever a user selects another applet). Our war file contains multiple signed jar files, and several other components/files that are not packaged in a jar file.
    Adding "deployment.security.mixcode=HIDE_RUN" to a client PC's deployment.properties file suppresses the new warning dialog, but is not a practical solution for our web customers.
    #1) Is there any logging facility available in a develop/test environment that identifies the offending unsigned item(s) ?
    #2) To use the Trusted-Only attribute, must every component/file in our war file be packaged in a signed jar file, or is there another alternative ?
    #3) For this issue and for similar deployment issues, how likely is the hope that the Oracle Java team will improve upon these Update 19 mixed code enhancements in a near-future Update ?

    What are you missing?
    I inherited this app and signing the third party jars is how it was setup, I was wondering the same thing too, why was it necessary to sign the third party jars?
    The applet runs in either JRE 1.6.0_13 or JRE 1.6.0_27 depending on the other Java apps the user uses. JRE 1.6.0_13 does not have the mixed code security (so it is like is disable), but JRE 1.6.0_27 does have the mixed code security and the applet will not launch with mixed code security enable, so we have to disable it. With all the hacking going on in the last two years, is important to improve security; so this is a must.
    Yes, I always clear up the cache.
    Any idea on how to resolve this problem?

  • How to create a custom ear file and deploy it onto a freshly created oc4j

    Hi,
    Wanted to know that how should i go about creating a custom EAR file or for that matter any application and deploy it onto a test oc4j instance created within the 10.1.3 Home of Oracle Apps R12.
    I believe in a standalone Application server installation it is quite simple to deploy an application by creating an oc4j instance using the AS console ,but not very sure about how to go about it in Oracle Apps .
    N.B:I have been able to create a test oc4j instance by the name of Test and able to start and stop it using the opmn of 10.1.3 oracle home.
    Any help in this regard will be appreciated.

    Hi,
    can you please post this question to one of the Apps forums if your main concern is to deploy applications in the context of Oracle Apps?
    It seems that you don't have a problem in creating the EAR file in JDev.
    Frank

Maybe you are looking for

  • Flash player crashes my computer when used . . . please help!

    the newest versions of flash player required for use in you tube and hulu crash my computer and causes it to reboot. I'm using windows xp home edition 32 bit, have updated my drivers, and have tried to use several different versions of the flash play

  • HT1386 Some iTunes purchased music no longer plays on my phone 4s.

    Recently my Iphone (which I have had for almost a year with no issue) 4s filled its memory with "Other" and it was coded yellow on the status bar.... This "other" filled my entire 32 gig phone which didnt allow any other information to be stored.  I

  • Deploying AMD Catalyst software via task sequence

    I am trying to have the AMD Catalyst software installed on all machines with an AMD video card. Right now I am using a WMI query in my task sequence on the video controller. When I image the machine, the AMD software does not install via task sequenc

  • No sound with mirroring

    I successfully mirror my iMac to my Apple TV, but I don't get sound to the Apple TV.  I Opt+click the volume icon on the menu bar, but Apple TV is not an option under output.  When I go to Sound preferences, my Apple TV shows up as an output option,

  • Error 4280 HELP!!

    When I try to burn a CD I keep getting an error message "4280" Can anyone help me solve this issue...thanks