I've attached the web app (weld-injection.zip). Instructions:
1) Unpack the zip.
2) Go to the root folder "weld-injection" and run the Maven command "mvn package".
3) Deploy the generated WAR file (located under "target" folder) in JBoss 7.1.1 Final.
4) Go to the URL: http://localhost:8080/weld-injection
This is because the MessageProvider bean could not be injected into the BaseController bean. The same injection in SuperContoller would work. The reason is @ViewScoped annotation. Another not JSF, CDI or CODI annotations work with the injection in BaseController.
I've attached the web app (weld-injection.zip). Instructions:
1) Unpack the zip.
2) Go to the root folder "weld-injection" and run the Maven command "mvn package".
3) Deploy the generated WAR file (located under "target" folder) in JBoss 7.1.1 Final.
4) Go to the URL: http://localhost:8080/weld-injection
You will see an Exception wich I reported:
java.lang.NullPointerException
jsf.SuperController.getMessage(SuperController.java:17)
jsf.SuperController$Proxy$$$_WeldClientProxy.getMessage(SuperController$Proxy$$$_WeldClientProxy.java)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
javax.el.BeanELResolver.getValue(BeanELResolver.java:302)
...
This is because the MessageProvider bean could not be injected into the BaseController bean. The same injection in SuperContoller would work. The reason is @ViewScoped annotation. Another not JSF, CDI or CODI annotations work with the injection in BaseController.