Your Customer
class has to be discovered by CDI as a bean. For that you have two options:
Put a bean defining annotation on it. As @Model
is a stereotype it's why it does the trick. A qualifier like @Named
is not a bean defining annotation, reason why it doesn't work
Change the bean discovery mode in your bean archive from the default "annotated" to "all" by adding a beans.xml
file in your jar.
Keep in mind that @Named has only one usage : expose your bean to the UI. Other usages are for bad practice or compatibility with legacy framework.