The JSR-299 specification states in §3.1:
If the managed bean class is a generic type, it must have scope @Dependent. If a managed bean with a parameterized bean class declares any scope other than @Dependent, the container automatically detects the problem and treats it as a definition error.
Effectively meaning that you can't do this:
@Named
@SessionScoped or @RequestScoped or similar
public class MyProducer<T> {...}
What are the technical reasons for this decision?
Will it be remedied in an upcoming version of CDI by any chance?
Is there a best practice for dealing with /working around this?
Thank you
EDIT - a workaround I can often use is to inject a generic POJO-bean into a bean with the needed scope. Often, but not always.
See Question&Answers more detail:os