EJB 3.1 @EJB Injection into POJO

前端 未结 4 1325
清歌不尽
清歌不尽 2020-12-05 08:22

With the new EJB 3.1 spec is it possible to inject an EJB into a pojo? I know in EJB 3.0 the @EJB annotation could be used to inject an EJB but this did not work on simple

4条回答
  •  星月不相逢
    2020-12-05 08:44

    Yes, use JNDI lookup.

    Since your POJO is created by you (I assume), the container is not responsible for injecting the dependencies.

提交回复
热议问题