facebook

Getting error when trying to access deployed Web application

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #249723 Reply

    piampri
    Member

    Hello,

    I created a build file for one of these applications which I build made up of simple jsps etc within the Struts framework. I build the file sucessfully using Ant no problems, but for some reason, I can only access the main page of the application. On clicking the search link, I get an error HTTP 404. I really really need someone’s help to figure this one out !!!

    I made sure that the index.jsp and search.jsp files are outside of the “WEB-INF” directory so that they are directly accessible to the user. However, from the index.jsp file, there is a link to the “search.jsp” file. That link results in the error. For some reason, it does not appear to be seeing the second jsp page. I must be missing something

    Here is the build file which I constructed :

    <project name="MiniHR" basedir="." default="compile">
        <!-- ANT tasks -->
        
        <target name="init">
            <property name="app.name" value="MiniHR"/>
            <property name="description" value="MiniHR"/>
            <echo message="----------- ${description} ------------"/>
            
            <!-- System environment -->
            <property environment="env"/>
            <property name="java.home" value="${env.JAVA_HOME}"/>
            <property name="wl.home" value="${env.WL_HOME}"/>
            <property name="env.classpath" value="${env.CLASSPATH}"/>  
            
            <!--Application environment  -->
            
            <!--Eclipse project stuctures following the following topology:
            workspace\[workspace name]\[project name]\WebRoot
            
            NB.All files required by the application are stored within the Webroot 
            folder. -->
            <property name="webroot.dir" value="${basedir}/WebRoot"/>
            <property name="web-inf.dir" value="${webroot.dir}/WEB-INF"/>
            <property name="lib.dir" value="${web-inf.dir}/lib"/>
            
            <!--Source files are stored within the "WEB-INF subdirectory -->
            <property name="src.dir" value="${web-inf.dir}/src"/>
            
            <!-- app lib -->
            <property name="j2ee.lib" value="${env.WL_HOME}/server/lib"/>
            
                            <!-- app build -->
            <property name="build.dir" value="work"/>
            <property name="build.ear" value="${build.dir}/ear"/>
            <property name="build.webinf" value="${webroot.dir}/WEB-INF"/>
            <property name="build.classes" value="${build.webinf}/classes"/>
            <property name="build.lib" value="${build.dir}/lib"/>
            <property name="build.war" value="${app.name}.war"/>
            
                            <!-- app dist (distribution) -->
            <property name="dist.ear" value="${app.name}WAS.ear"/>
            
                            <!-- deploy -->
            <property name="deploy.dir" value="{$main}/deploy"/>
            
                            <!--jspcompilationoutput -->
            <property name="build.jspcompilationoutput" value="${build.dir}/jspcompilationoutput"/>
            
                            <!-- ClassPath -->
            <path id="classes.path.compile">
                <pathelement location="${j2ee.lib}/weblogic.jar"/>
                <fileset dir="${lib.dir}">
                    <include name="commons-beanutils.jar"/>
                    <include name="commons-collections.jar"/>
                    <include name="commons-digester.jar"/>
                    <include name="commons-fileupload.jar"/>
                    <include name="commons-lang.jar"/>
                    <include name="commons-logging.jar"/>
                    <include name="commons-validator.jar"/>
                    <include name="jakarta-oro.jar"/>
                    <include name="struts-legacy.jar"/>
                    <include name="struts.jar"/>
                </fileset>
                <pathelement path="${build.classes}"/>
            </path>
            <patternset id="sources.jsp.path">
                <include name="**/*.jsp"/>
            </patternset>
            <patternset id="sources.path">
                <include name="**/*.java"/>
            </patternset>
            <echo message="-----------Init task complete------------"/>
        </target>
        
        <!--
        =================================================================================
        Cleanup tasks.
        =================================================================================
        -->
        <target name="clean" depends="init">
            <delete dir="${build.dir}" failonerror="false"/>
            <delete file="${basedir}/${dist.ear}" failonerror="false"/>
            <echo message="-----------Clean task complete------------"/>
        </target>
    
        <target name="prepare" depends="init">
            <!-- Check timestamp on files -->
            <tstamp/>
            <mkdir dir="${build.dir}"/>
            <mkdir dir="${build.ear}"/>
            <!--create output directory for jspcompilation -->
            <mkdir dir="${build.jspcompilationoutput}"/>
        </target>
        
         <!-- Copy any resource or configuration files -->
        <target name="resources">
            <delete dir="${build.classes}"/>
            <copy todir="${build.classes}">
                <fileset dir="${src.dir}" includes="**/*.properties"/>
            </copy>
            <copy todir="${build.classes}">
                <fileset dir="${src.dir}" includes="**/*.version"/>
            </copy>
        </target>
        
        
        <!--
        =================================================================================
        Compilation of classes.
        =================================================================================
        -->
        <target name="compile" depends="prepare, resources">
            <javac srcdir="${src.dir}" destdir="${build.classes}" debug="on" optimize="off" deprecation="off">
                    <patternset refid="sources.path"/>
                    <classpath refid="classes.path.compile"/>
            </javac>
        </target>
        
        
        <!--
        =================================================================================
        Building war file.
        =================================================================================
        -->
        <target name="build-war" depends="compile" description="Building WAR file">      
            <war warfile="${build.dir}/${build.war}" webxml="${build.webinf}/web.xml">
                <fileset dir="${webroot.dir}" includes="**/*.*" excludes="*.war, **/*.nbattrs, web.xml, **/WEB-INF/**/*.*, **/project-files/**/*.*"/>
                <webinf  dir="${web-inf.dir}"    includes="**/*" excludes="web.xml, **/*.jar, **/*.class"/>
                    <lib     dir="${lib.dir}"/>
                    <classes dir="${build.classes}"/>
                    <classes dir="${src.dir}">
                       <include name="**/*.properties"/>                
                    </classes>
            </war>    
            <echo message="-----Done--------"/>
        </target>
        
    </project>
    #249789 Reply

    Riyad Kalla
    Member

    What is the URL (in your browser) to your index.jsp page, and what is the URL in your browser when you click the link to search?

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Getting error when trying to access deployed Web application

You must be logged in to post in the forum log in