User context for @Startup EJB on websphere

♀尐吖头ヾ 提交于 2020-01-05 18:10:12

问题


Where do I set the user context Websphere uses when it calls a @Startup 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.


回答1:


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.



来源:https://stackoverflow.com/questions/33103036/user-context-for-startup-ejb-on-websphere

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