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

Servlet not injected into newly created action in higly concurrent env

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.8
    • Fix Version/s: 1.3.10, 1.4.0
    • Component/s: Core
    • Labels:
      None
    • Environment:
      win xp, jvm 1.5.0_12

      Description

      In struts 1.3.8 we encountered such an issue

      getServlet() invoked from action code returns null.

      After quick investigation I found a bit susspicious place in the
      RequestProcessor#processActionCreate code.
      The synchronized block seems to be a bit risky in highly concurrent environment because it does not cover also the code injecting servlet into freshly created action:

      if (instance.getServlet() == null) {
      instance.setServlet(this.servlet);
      }

      After I had extended synchronisation to above code fragment, it seems, our nullpointer vanished.

        Attachments

        1. RequestProcessor.patch
          0.5 kB
          Bartek Wasko

          Activity

            People

            • Assignee:
              niallp Niall Pemberton
              Reporter:
              bartek Bartek Wasko
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: