在 WebSphere 9 上,我正在尝试从 CDI 扩展进行 JNDI 查找,但出现此错误:
javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the server runtime is not able to associate the operation's thread with any J2EE application component...
因此,在 JavaEE 组件生命周期回调中,有由服务器管理的线程执行的应用程序代码(在 EAR 内),但没有有界的 JNDI 上下文。
我玩过com.ibm.ws.cdi.immediate.ejb.start系统属性,看看这是否有帮助,但我没有运气。
有没有人遇到过这个问题?有什么解决办法吗?