You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Patrick Savage (Created) (JIRA)" <ji...@apache.org> on 2011/10/10 22:16:29 UTC

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

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


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

        

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

Posted by "Lukasz Lenart (Resolved) (JIRA)" <ji...@apache.org>.
     [ 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

        

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

Posted by "Patrick Savage (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Savage updated WW-3692:
-------------------------------

    Attachment: WW-3692.patch
    
> 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
>         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

        

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

Posted by "Lukasz Lenart (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart reassigned WW-3692:
---------------------------------

    Assignee: Lukasz Lenart
    
> 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
>         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

        

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

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124740#comment-13124740 ] 

Hudson commented on WW-3692:
----------------------------

Integrated in Struts2 #362 (See [https://builds.apache.org/job/Struts2/362/])
    WW-3692 - uses containsBean() method instead of containsBeanDefinition() to resolve aliases of a bean to find

lukaszlenart : 
Files : 
* /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringObjectFactory.java

                
> 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
>         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

        

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

Posted by "Lukasz Lenart (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart closed WW-3692.
-----------------------------

    
> 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