[cdi-dev] passivation capable parameters for producerMethods

Mark Struberg struberg at yahoo.de
Wed Jun 29 08:57:02 EDT 2011


Section 6.6.4 declares that:

> If a producer method declares a passivating scope and:
> ..
> * has a parameter that does not resolve to a passivation capable 
> dependency, 
> then the container automatically detects the problem and 
> treats it as a deployment problem.

What is the reason for this restriction?
Something like

 @Produces @SessionScoped @AutoAuthenticated
 public User getCurrentUser(EntityManager em) {
   return ...

(EntityManager gets produced as @RequestScoped) would not be allowed because EntityManager is not Serializable.

txs and LieGrue,

More information about the cdi-dev mailing list