@Inject stateless EJB contains data from previous request

穿精又带淫゛_ 提交于 2019-11-29 17:23:22
BalusC

You have the meaning of @Stateless backwards.

This does not mean like so:

Hey container, here's an arbitrary class, please make it a stateless bean.

This actually means like so:

Hey container, here's a stateless class, you can safely use it as a stateless bean.

You have a stateful class. You should mark it as a @Stateful bean. Otherwise, get rid of all the state (unmanaged instance variables) so you can safely use it as a @Stateless bean.

See also:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!