This discussion is archived
8 Replies Latest reply: Jan 9, 2013 1:23 PM by ThomasBoxall RSS

JDeveloper - Struts Web App - Application compiles, 404 error on run

ThomasBoxall Newbie
Currently Being Moderated
I'm developing a web app for a client and I'm using JDeveloper 10.1.3.5, with Struts (version 1). The application compiles properly but when I run the application, I'm getting a 404 Not Found error from the web browser. There are no error messages in the log.
If I try to call a jsp directly I get the following error in the error log:

INFO: Unable to dispatch JSP Page : Exception:java.io.FileNotFoundException:

From my investigation of the issue, it appears that I've configured something incorrectly, but all the sites I've checked out don't go as far as to say what is configured incorrectly. I would appreciate any help I can get with this.
  • 1. Re: JDeveloper - Struts Web App - Application compiles, 404 error on run
    maheshguruswamy Journeyer
    Currently Being Moderated
    ThomasBoxall wrote:
    I'm developing a web app for a client and I'm using JDeveloper 10.1.3.5, with Struts (version 1). The application compiles properly but when I run the application, I'm getting a 404 Not Found error from the web browser. There are no error messages in the log.
    If I try to call a jsp directly I get the following error in the error log:

    INFO: Unable to dispatch JSP Page : Exception:java.io.FileNotFoundException:

    From my investigation of the issue, it appears that I've configured something incorrectly, but all the sites I've checked out don't go as far as to say what is configured incorrectly. I would appreciate any help I can get with this.
    Looks like your web application does not know what to do with the URL that the browser sent it. Browser sends the URL to your web app -> web application looks at web.xml -> hands it off to the struts servlet for handling etc etc. Trace it through each step.
  • 2. Re: JDeveloper - Struts Web App - Application compiles, 404 error on run
    ThomasBoxall Newbie
    Currently Being Moderated
    Still no dice. I've played around with the Run/Debug Project Properties, the struts-config.xml, and the web.xml with no results. Is there something specific with each of these areas (or something outside these areas) that I'm missing and should look into?
  • 3. Re: JDeveloper - Struts Web App - Application compiles, 404 error on run
    Kayaman Guru
    Currently Being Moderated
    ThomasBoxall wrote:
    The application compiles properly
    That is quite a redundant statement, since compile time errors are trivial to fix.
    From my investigation of the issue, it appears that I've configured something incorrectly, but all the sites I've checked out don't go as far as to say what is configured incorrectly. I would appreciate any help I can get with this.
    Post your web.xml, struts-config and directory structure, as well as the URL you're trying to connect to.
  • 4. Re: JDeveloper - Struts Web App - Application compiles, 404 error on run
    ThomasBoxall Newbie
    Currently Being Moderated
    Due to my agreement with my client, I'm not allowed to show all the information you requested, but here is the information I can show:

    web.xml
    <?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">
    <web-app>
        <description>Empty web.xml file for Web Application</description>
        <context-param>
            <param-name>CpxFileName</param-name>
            <param-value>viewcontroller.DataBindings</param-value>
        </context-param>
        <filter>
            <filter-name>adfBindings</filter-name>
            <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
        </filter>
        <filter>
            <filter-name>adfFaces</filter-name>
            <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>adfBindings</filter-name>
            <url-pattern>*.jsp</url-pattern>
        </filter-mapping>
        <filter-mapping>
            <filter-name>adfBindings</filter-name>
            <url-pattern>*.jspx</url-pattern>
        </filter-mapping>
        <filter-mapping>
            <filter-name>adfFaces</filter-name>
            <url-pattern>*.jsp</url-pattern>
        </filter-mapping>
        <filter-mapping>
            <filter-name>adfFaces</filter-name>
            <url-pattern>*.jspx</url-pattern>
        </filter-mapping>
    <!-- Removed content -->
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
    <!-- Removed content -->
        <servlet>
            <servlet-name>Faces Servlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>DocumentServlet</servlet-name>
            <url-pattern>/documentservlet</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>/faces/*</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>60</session-timeout>
        </session-config>
        <mime-mapping>
            <extension>html</extension>
            <mime-type>text/html</mime-type>
        </mime-mapping>
        <mime-mapping>
            <extension>txt</extension>
            <mime-type>text/plain</mime-type>
        </mime-mapping>
        <taglib>
            <taglib-uri>http://displaytag.sourceforge.net/</taglib-uri>
            <taglib-location>/WEB-INF/displaytag-11.tld</taglib-location>
        </taglib>
    </web-app> 
    struts-config.xml
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
      <form-beans>
    <!-- content removed -->
      </form-beans>
      <global-forwards>
    <!-- content removed -->
      </global-forwards>
      <action-mappings>
    <!-- content removed -->
      </action-mappings>
      <controller>
    <!-- content removed -->
      </controller>
    <!-- content removed -->
      <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
        <set-property property="pathnames" value="/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml"/>
      </plug-in>
    <!-- content removed -->
    </struts-config>
    Directory Structure
    Web content is stored under the public_html folder of the main module of the project. I can't divulge much beyond that, sorry.

    URL
    http://##url##:##port##/##project##/start.do
  • 5. Re: JDeveloper - Struts Web App - Application compiles, 404 error on run
    maheshguruswamy Journeyer
    Currently Being Moderated
    ThomasBoxall wrote:
    Still no dice. I've played around with the Run/Debug Project Properties, the struts-config.xml, and the web.xml with no results. Is there something specific with each of these areas (or something outside these areas) that I'm missing and should look into?
    If its not something readily obvious, I say attach the struts source and start debugging.
  • 6. Re: JDeveloper - Struts Web App - Application compiles, 404 error on run
    ThomasBoxall Newbie
    Currently Being Moderated
    I was able to talk to my client's internal support team. They were able to identify that my OC4J Server is not configured correctly, but they couldn't/wouldn't take me through the configuration process. Does someone have a link to a configuration guide that will help me set up a local OC4J Server in JDeveloper 10.1.3.5? The following official documentation wasn't very helpful:
    http://www.oracle.com/technetwork/developer-tools/jdev/install-091582.html#oc4j
  • 7. Re: JDeveloper - Struts Web App - Application compiles, 404 error on run
    aksarben Journeyer
    Currently Being Moderated
    This doesn't address your problem directly, but I'm wondering (1) Are you at the very early design/testing stage of your project? and (2) Why are you using an old obsolete version of Struts (latest version is 2.3.8)?

    If your project is at an early enough stage where you have the option to consider frameworks other than Struts, I'd strongly recommend it. I maintain an old legacy Struts app (written many years ago), and it is an absolute nightmare. Struts is long past its prime, IMHO. Many considered it bleeding edge technology when it first came out, but I suspect Struts cheerleaders are pretty scarce nowadays.
  • 8. Re: JDeveloper - Struts Web App - Application compiles, 404 error on run
    ThomasBoxall Newbie
    Currently Being Moderated
    In answer to your questions:
    1) The project is close to deployment.
    2) Because the client said so.

    I agree fully with your statements, but as a contractor developer that was brought in late in the development cycle, I must use the tools provided and do the best job I can with them. I know that there are several issues I'm having that would be instantly solved if I could dictate what framework, IDE, and tools I could use. This isn't the case so here I am asking for help to get a broken system fixed.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points