Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2249

NullPointerException in ActionServlet

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.4
    • 1.2 Family
    • Core
    • None
    • Operating System: All
      Platform: All
    • 31761

    Description

      If somebody mistypes the name of a struts-config file (or gives the name of a
      non-existent one) in the web.xml file, a nasty NullPointerException occurs.
      For example:

      <servlet>
      <servlet-name>action</servlet-name>
      <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

      ...

      <init-param>
      <param-name>config/path2</param-name>
      <param-value>/WEB-INF/strust-config-path2.xml</param-value>
      </init-param>
      </servlet>

      (notice that I purposely added a mispelling in the <param-value>),
      ActionServlet.parseModuleConfigFile will throw a NullPointerException without
      much additional information. When you have a billion different config modules
      (as we do), it can be almost impossible to troubleshoot without stepping into
      the source code.

      Propose adding a check to parseModuleConfigFile that will throw a more
      meaningful exception, including the name of the module whose config file it was
      unable to find to aid troubleshooting when this situation occurs.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jdaviestx@comcast.net Joshua Davies
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: