Servlet not injected into newly created action in higly concurrent env
----------------------------------------------------------------------

                 Key: STR-3161
                 URL: https://issues.apache.org/struts/browse/STR-3161
             Project: Struts 1
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.3.8
         Environment: win xp, jvm 1.5.0_12
            Reporter: Bartek Wasko


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to