Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-2543

Weird Codebehind startup bug (race condition, no magic way to reproduce) : switches interceptor stacks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.1
    • 2.1.3
    • Plugin - CodeBehind
    • None

    Description

      Hi,

      I know this bug report is really vague and hard to reproduce, but I thought it'd be useful to publicly report the problem so that other people who get the same behavior can try to give more details...

      My struts config :
      Several packages defined : "default", "longProcess", "simple", and each package has its own default interceptor ref (defaultStack for "simple", longProcessStack for "longProcess", and a custom interceptor stack for "default".

      If I activate the codebehind, and map different actions to different parent packages :
      @ParentPackage("longProcess")

      @ParentPackage("simple")

      @ParentPackage("default")

      And what seems to happen is that randomly, the webapp is sometimes started correctly, and sometimes started in a "screwed-up" mode. What "screwed-up" mode means is that the actions have a randomly chosen package ("longProcess", "simple", or "default". (the visible behaviour is that the wrong interceptor stacks are applied )

      sometimes means at least one startup out of ten (mvn clean compile tomcat:run, or mvn clean compile jetty:run). Sometimes less, sometimes more.... I have the feeling that if I hit the web application soon enough right after everything is initialized, I have more chances to boot into "screwed-up mode".

      1] I could not reproduce the problem with codebehind disabled
      2] I could not reproduce the problem when only one package name is used in @ParentPackage
      3] I have the feeling that the more codebehind-annotated actions there are on the webapp, the more chances I have to hit the bug.

      I know this is weird... After relaunching my webapp for a few hundred times, I cannot find more information than that....

      Attachments

        Activity

          People

            mrdon Donald J. Brown
            samokk Sami Dalouche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: