Issue Type: Bug Bug
Affects Versions: 1.1.8.Final
Assignee: Unassigned
Components: Scopes & Contexts, Web Tier integration (JSF, JSP, EL and Servlet)
Created: 02/Aug/12 3:42 PM
Description:

Currently I have headache with MyFaces CODI mapping / porting of JSF @ViewScope to CDI (https://svn.apache.org/repos/asf/myfaces/extensions/cdi/trunk/jee-modules/jsf20-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf2/impl/scope/view/). This is quite good with OpenWebBeans, but not with Weld. @Inject in a base class doesn't work in JBoss 7 if the derived class has JSF @ViewScope. It works if it has CODI's @ViewAccessScope. But not with @ViewScope. Example:

public abstract class A implement Serializable {
    @Inject private SomeSessionScopedBean bean;

    public SomeSessionScopedBean getBean() {
        return bean;
    }  
}

@Named
@ViewScope
public class B extends A {
    public void doSomething() {
        getBean().someMethod();   // NullPointerException here because bean was not injected
    } 
}

It works with OWB as I said. And it works in Weld too if I move @Inject ... to the class B. I think this is because Weld doesn't know about mapping of ViewScope.class, there isn't a SPI Extension in META-INF/services (no new annotation). Right? Can you confirm this?

Many thanks in advance for any tips.

Environment: JBoss 7.1.1 final, JSF 2, JSF impl. Mojarra 2.1.10.
Project: Weld
Priority: Major Major
Reporter: Oleg Varaksin
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira