I've got stateful EJB and injected to it application scope CDI bean. Findbugs gave a warning, because my CDI bean was not serializable. Should the CDI bean be serializable in this case? In my opinion it shouldn't, in order to avoid passivation. Is making this field 'transient' enough, and is this a proper solution?

有帮助吗?

解决方案

I wouldn't worry about it honestly. You're probably getting a PassivationCapable proxy in reality and FindBugs certainly doesn't know that.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top