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