-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
-
1.1.8.Final
-
None
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.