When you create a new NetBeans JSF project you will want to use Contexts
and Dependency Injection (CDI).
Unfortunately there is a defect in the 8.0 versions of NetBeans.
It does not automatically add a beans.xml
configuration
file.
This causes problems when you create new JSF managed beans.
This problems can be avoided by manually adding the file
before you create them.
First check to see if the file is missing by expanding the
"Web Pages/WEB-INF" item in the project as shown below.
If there is a file beans.xml
then you do not need to add
it.
If it is missing it can be added with the following steps.
The "New File" wizard has two steps:
The defaults here are correct.
The defaults here are correct.
After a few seconds the beans.xml file should appear.