【问题标题】:how to give custom JNDI name to an EJB 3.0 bean in WebSphere如何为 WebSphere 中的 EJB 3.0 bean 提供自定义 JNDI 名称
【发布时间】:2013-10-02 10:33:28
【问题描述】:

谁能告诉我如何为 WebSphere 7 中的 EJB 3.0 无状态(本地)会话 bean 组件提供自定义 JNDI 名称?我知道服务器正在为ejblocal:<fully qualified interface name> 之类的东西提供默认名称。但我不想在我的客户端查找中使用这个名称。

我也想知道同样的方法是否也适用于 WebSphere 8.0?

【问题讨论】:

    标签: java java-ee-5


    【解决方案1】:
    interface @Remote 
    public interface HellowWorldBeanRemote {} 
    bean class import javax.ejb.Stateless; 
    @Stateless(mappedName="HelloWorld") //Giving custom Jndi name to ejb 
    public class HellowWorldBean implements HellowWorldBeanRemote {}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-20
      • 2018-03-02
      • 2013-01-04
      • 2023-03-09
      • 1970-01-01
      • 2016-05-12
      • 2012-09-19
      • 2013-01-30
      相关资源
      最近更新 更多