You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Resolved) (JIRA)" <ji...@apache.org> on 2011/10/11 08:34:30 UTC

[jira] [Resolved] (WW-3692) Struts cannot find Spring beans with no id set

     [ https://issues.apache.org/jira/browse/WW-3692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart resolved WW-3692.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3

Patch applied, thanks!
                
> Struts cannot find Spring beans with no id set
> ----------------------------------------------
>
>                 Key: WW-3692
>                 URL: https://issues.apache.org/jira/browse/WW-3692
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Spring
>    Affects Versions: 2.2.3
>            Reporter: Patrick Savage
>            Assignee: Lukasz Lenart
>             Fix For: 2.3
>
>         Attachments: WW-3692.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira