I am now learning about CDI scope in Java EE 7 tutorial and finding that in the last paragraph it says
Beans that use session, application, or conversation scope must be serializable, but beans that use request scope do not have to be serializable.
But what confused me a lot is that in my IDE (Netbeans and IntelliJ Idea), when I use @SessionScoped or @ConversationScoped, it does give me an error if I am not implementing the Serializable just like what the Java EE 7 tutorial has said, and obviously, I can't build the project then run it. Things get strange when I use @ApplicationScoped but not implementing the Serializable, no errors come out and I can build then run the application normally.
So I'm very curious about that and really want to know why. Could you please explain what happened there? Thank you so much!
The errors in your IDE are showed basically because your IDE has some plugin for this (which is not to be trusted 100% btw).
The reasons for serialization are as follows:
@SessionScoped
beans
@ConversationScoped
beans
@ApplicationScoped
beans
Serializable
presence