Migration of Existing JSP to 10g Environment


Web tier: servlets, JSP, Web frameworks: Migration of Existing JSP to 10g Environment

  1. Migration of Existing JSP to 10g Environment (2 messages)

    We have bunch of .JSP's around 300 in numbers and few Java Classes(which is our bean library).
    I want to import those .jsp's and my library inside our Jdeveloper development environment. And i have achieved this task.
     o In Jdeveloper I choosed Application Workspace (No Templates All Technologies).
     o Then i created my java classes (our bean library) by clicking new Java Classes wizard and compiled them.
     o Then i created a jsp file and cut & pasted my actual code into this jsp file.
     o i compiled this also and run the jsp which called few functions in our java classes.
     o It started Embedded OC4J and it executed my jsp well.
    Now i had the problem when deploying it to my Oracle App Server.
     o Now i created a new web deployment profile .war file
     o I named it and specified the J2EE Web Context root as "builders".
     o I left every other option to default and clicked ok.
     o Now i right clicked the .deploy file and "Deploy to war file".
     o Then I right clicked and choosed deploy to my application server.
     o I got the messge Deployment finished.
    I tried to access the application which i just deployed.
    It displays the first page index.html (which is in
    in Web.xml file)
     From that index.html i have a link to jsp in the same directory. When i clicked the link i got java.io.FileNotFoundException.
    This happens even to the html file(But 404 file not found exception) if i remove the <Welcome-file-list> from web.xml file.
    This is the scenario.
    Could anyone of you please let me know what are all the steps i should take care while deploying jsp's. Like deployment profile, Descriptor kind of stuff.
    I tried doing my hand.

    I tried to deploy using the following directory structure.
         web-inf\classes\New_Portal_Java_Classes\*.class ( Java class file which jsp will refer for database object)
    I issued a command to create a war file
    C:\oc4jtest\builders\jar -cvf builders.war *
    Then i copied builders.war a directory back Now,
    Now I issued a command to create a ear file
    c:\oc4jtest\builders\jar cvf builders.ear builders.war META-INF
    Now I have
     Then I deployed using Oracle 10g Appserver Console.
    Then i tried to view to page:

    It displayed the page index.html file then i enter something and clicked on submit i got
    Request URI:/builders/display.jsp
    Could you please suggest me where i am doing wrong. what are all the important things which i should take care of. I have provided the code listing below. Which technology i should choose, what are all the things i should consider when creating deployment profile,descriptor etc.
    Shahul Hameed
    application.xml listing
    <?xml version="1.0"?>
    <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" "http://java.sun.com/j2ee/dtds/application_1_2.dtd">
       <display-name>Is Web Cache Working</display-name>
    Web.xml listing
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
      <description>Empty web.xml file for Web Application</description>
    index.html source
    <HEAD><TITLE>The Welcome User JSP</TITLE></HEAD>
    Enter name:
    <FORM action="display.jsp">
    <INPUT TYPE="text" NAME="user" SIZE=15>
    <INPUT TYPE="submit" VALUE="Submit name">
    display.jsp Source
    <%@ page language="java" import="New_Portal_Java_Classes.*, java.util.*;" %>
    <HEAD><TITLE>The Welcome User JSP</TITLE></HEAD>
    <% String user=request.getParameter("user"); %>
    <H3>Welcome <%= (user==null) ? "" : user %>!</H3>
    <P> Today is <%= new java.util.Date() %>. Have a fabulous day! :-)</P>
  2. Check the WAR[ Go to top ]

    If you unpack the WAR, or just examine it in an Archiving tool like WinZip or Ark do you see everything you expect to see e.g
    The classes you have under WEB-INF as well as the web.xml and jsps.
    I just created a JSP project from scratch just like this - the only additional step I carried out was to edit the project properties and add JSP & Servlets to the Technology scope.
    The WAR file ended up with just my class under WEB-INF (upper case), my jsp in the root and web.xml under WEB-INF as well.
  3. I unpacked the war. Everything is same as you have said. The one thing i left is i haven't added JSP & Servlets to the Technology scope. Now I did that stuff also and deployed it to war file and then deployed to my app server.

    But the result is still the same.. i am still getting FileNotFoundException.