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

Struts cannot find Spring beans with no id set

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.3.1
    • Component/s: Plugin - Spring
    • Labels:
      None
    • Flags:
      Patch

      Description

      The fix for WW-3460 prevents Struts from finding Spring beans that do not have an "id" set (typical for actions, interceptors, etc.). The containsBeanDefinition method returns false when the bean's class name is passed into it because the bean definition id is actually the class name plus "#0". There is an alias from the class name to the bean definition id, but containsBeanDefinition ignores that alias.

      The solution is to use the containsBean method instead of containsBeanDefinition. This resolves the alias to the real bean definition id and so it is able to find the bean. Please apply the attached patch to fix this problem.

        Attachments

        1. WW-3692.patch
          0.8 kB
          Patrick Savage

          Activity

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              psavage Patrick Savage
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: