[weld-issues] [JBoss JIRA] (WELD-973) @Specializes is not compatible with seam-config because of a problem in weld's BeanDeployerEnvironment

Ales Justin (Commented) (JIRA) jira-events at lists.jboss.org
Sat Nov 19 04:38:40 EST 2011


    [ https://issues.jboss.org/browse/WELD-973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644160#comment-12644160 ] 

Ales Justin commented on WELD-973:
----------------------------------

@Geoffrey: can you try my Weld Core branch weld-912, to see if the issue is still there?
(https://github.com/alesj/core/tree/weld-912)

                
> @Specializes is not compatible with seam-config because of a problem in weld's BeanDeployerEnvironment
> ------------------------------------------------------------------------------------------------------
>
>                 Key: WELD-973
>                 URL: https://issues.jboss.org/browse/WELD-973
>             Project: Weld
>          Issue Type: Bug
>    Affects Versions: 1.1.2.Final
>            Reporter: Geoffrey De Smet
>
> BeanDeployerEnvironment has 2 methods which - combined with seam-config - break @Specializes:
> {code}
> public class BeanDeployerEnvironment {
>    private final Map<WeldClass<?>, AbstractClassBean<?>> classBeanMap;
>    protected void addAbstractClassBean(AbstractClassBean<?> bean)
>    {
>       ...
>          classBeanMap.put(bean.getWeldAnnotated(), bean);
>       ...
>    }
>    public AbstractClassBean<?> getClassBean(WeldClass<?> clazz)
>    {
>       if (!classBeanMap.containsKey(clazz))
>       {
>          return null;
>       }
>       ...
>    }
> {code}
> Here's what happens:
> In this use case I have a bean RepositoryStartupService, which is extra configured by seam-config.
> It is also specialized by TestRepositoryStartupService (for tests).
> 1) First addAbstractClassBean is called with these parameters:
> {code}
> bean = Managed Bean [class org.drools.guvnor.server.repository.RepositoryStartupService] with qualifiers [@Any @Default @Named]
> bean.bean.getWeldAnnotated() = public at Named @XmlConfiguredBean @ApplicationScoped @XmlId class org.drools.guvnor.server.repository.RepositoryStartupService
> {code}
> 2) Later on, getClassBean is called to find the parent class RepositoryStartupService:
> {code}
> clazz = public at Named @ApplicationScoped class org.drools.guvnor.server.repository.RepositoryStartupService
> {code}
> which returns null because the @XmlConfiguredBean bits are missing.
> So I get this exception message:
> {code}
> org.jboss.weld.exceptions.DefinitionException: WELD-000047 Specializing bean must extend another bean:  Managed Bean [class org.drools.guvnor.server.repository.TestRepositoryStartupService] with qualifiers [@Any @Default]
> {code}
> One can argue that since seam-config is not configuring TestRepositoryStartupService a failure is normal,
> but *even in that case the exception message is very misleading*, as looking at the code TestRepositoryStartupService clearly extends RepositoryStartupService which is also a bean.

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

        


More information about the weld-issues mailing list