CDI: SessionScoped-Bean must be passivation capable

Due to some questions about Session/ConversationScoped managed beans in CDI I answered during the last days I decided to wrote a little post about it. Another reason was that there seems to be no information about that issue (except of the origin specification ūüėČ ).

Nearly every single question was around the error message “WELD-000072” which targets the problem that a managed bean declares a passivating scoped but isn’t passivation capable. ¬†The original message from glassfish announces that

This message only¬†occurs if you declare a bean to be SessionScoped or ConversationScoped and didn’t let it implement the java.io.Serializable¬†interface.

The bean must be Serializable because the application server must be able to cache the created instance so it can be shared between multiple calls in the same session (the active client) or the same conversation (which is linked to currently opened browser window).

Cheers

Peter

 
7 Kudos
Don't
move!

One thought on “CDI: SessionScoped-Bean must be passivation capable


Leave a Reply

Your email address will not be published. Required fields are marked *