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

Struts cannot find Spring beans with no id set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.3
    • 2.3.1
    • Plugin - Spring
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: