websphere上的@Startup EJB的用户上下文 [英] User context for @Startup EJB on websphere
问题描述
我在哪里设置Websphere在调用@Startup EJB时使用的用户上下文?
Where do I set the user context Websphere uses when it calls a @Startup EJB?
我有一个包含启动EJB的Java EE应用程序,我知道它在调用EJB时设置用户,因为调用由于缺少角色而失败。但是,我找不到在哪里设置用户。
I have a Java EE application with a startup EJB, and I know that it sets a user when calling the EJB, since the call fails due to missing roles. However, I couldn't find where to set the user.
推荐答案
EJB规范说明会话bean @PostConstruct
方法在未指定的安全上下文中调用,WebSphere不会记录特定的安全上下文或允许其配置。实际上,单例会话bean @PostConstruct
通常会以非授权用户作为安全上下文来调用。如果设置特定的安全上下文很重要,那么您可以打开一个 WebSphere RFE ,但我建议找到另一个解决方案,以避免供应商特定的解决方案。
The EJB spec states that session bean @PostConstruct
methods are called in an unspecified security context, and WebSphere does not document a specific security context or allow it to be configured. In practice, singleton session bean @PostConstruct
will typically be called with an unauthorized user as the security context. If setting a specific security context is important, then you could open a WebSphere RFE, but I would recommend finding another solution to avoid a vendor-specific solution.
这篇关于websphere上的@Startup EJB的用户上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!