Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果 EJB3 无状态/有状态 bean no args 构造函数抛出异常,会发生什么?例如,A 类有一个 DI:
@EJB B b;
B 在构造函数中抛出异常?我没有在 EJB3 规范中找到任何关于这种情况的提及。我猜想 A 类的实例被丢弃了,因为它真的没有办法成功完成它的任务。
IME 如果您的任何 EJB 在启动应用程序时未能初始化,则应用服务器知道发生了问题并且不会将您的应用程序标记为可用。
发生这种情况时,您的 EJB / Web URL 不可用...
javax.ejb.EJBTransactionRolledbackException
当您使用 b 的方法时。
当您尝试使用 b 时,通常会出现空指针异常。