[seam-issues] [JBoss JIRA] (SOLDER-240) ServletContextAttributeProvider uses wrong servlet ctx. attribute name to lookup the bean manager

Christian Kaltepoth (Commented) (JIRA) jira-events at lists.jboss.org
Sun Nov 20 06:17:40 EST 2011

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

Christian Kaltepoth commented on SOLDER-240:

I just had a deeper look at this issue.

ServletContextAttributeProvider tries to lookup the BeanManager using the attribute name "javax.enterprise.inject.spi.BeanManager". The problem is that this attribute is not used by all CDI implementations. AFAIK this attribute name works for:

 * Weld 1.0.x
 * OpenWebBeans (see [OWB-360|https://issues.apache.org/jira/browse/OWB-360])

Unfortunately Weld 1.1.x uses a different attribute name. This was already [discussed on the forums|http://seamframework.org/Community/GettingBeanManagerFromServletContextWithWeld110]. Fortunately the attribute name will finally be specified in CDI 1.1 (see [CDI-73|https://issues.jboss.org/browse/CDI-73]).

Another interesting issue: While working on this I found out that ServletContextAttributeProvider seems to don't work at all. The class uses a ThreadLocal that holds the ServletContext. But the ServletContext from the ThreadLocal is always null when the BeanManagerLocator tries to invoke this provider. I tested this with AS7 and Tomcat7. I've currently no idea what is going wrong here.
> ServletContextAttributeProvider uses wrong servlet ctx. attribute name to lookup the bean manager
> -------------------------------------------------------------------------------------------------
>                 Key: SOLDER-240
>                 URL: https://issues.jboss.org/browse/SOLDER-240
>             Project: Seam Solder
>          Issue Type: Bug
>          Components: Servlet
>    Affects Versions: 3.0.0.Final
>         Environment: JDK6, Tomcat 6, weld-servlet 1.1.1.Final, seam-solder 3.0.0.Final, seam-servlet 3.0.0.Final
>            Reporter: Daniel Kvasnička
>            Priority: Critical
> org.jboss.seam.servlet.beanManager.ServletContextAttributeProvider uses BeanManager.class.getName() to lookup the bean manager in servlet context, but the name of the attribute used in sub-servlet3.0 containers is now org.jboss.weld.environment.servlet.Listener.BEAN_MANAGER_ATTRIBUTE_NAME -- AFAIK (see https://issues.jboss.org/browse/RESTEASY-471).

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 seam-issues mailing list