【问题标题】:How to deploy a Configuration to the JNDI tree of the Glass fish server如何将配置部署到 Glass 鱼服务器的 JNDI 树
【发布时间】:2010-06-14 06:56:21
【问题描述】:

我想将配置的 HashMap 部署到 Glass Fish 服务器的 JNDI 树。我正在将一个框架从 Weblogic 迁移到 GLassfish。以前它是通过以下代码完成的..

环境在哪里 weblogic.jndi.Environment;

public void deployConfiguration(HashMap configuration)
    throws GenericFrameworkException {
    Context ictx = null;
    String configParameter = null;
    Environment env = new Environment();
    env.setReplicateBindings(false);
    // get the NOT replicating initial context of this server
    ictx = ServiceLocator.getNotReplicatingInitialContext();
    if (ictx != null) {
      Set e = configuration.keySet();
      Iterator iter = e.iterator();
      while (iter.hasNext()) {
        configParameter = (String) iter.next();
        this.addParameter(
          ictx,
          Constants.JNDI_SUB_PATH,
          configParameter,
          configuration.get(configParameter));
      }
    }
  }

谁能建议如何在 Glassfish 中实现这一点

提前致谢。

【问题讨论】:

    标签: glassfish weblogic jndi


    【解决方案1】:

    您似乎正在寻找自定义 jndi 资源:

    http://docs.oracle.com/cd/E26576_01/doc.312/e24930/jndi.htm#beanz

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-18
      • 2023-03-06
      • 2011-02-26
      • 2023-03-14
      • 1970-01-01
      • 2020-05-09
      • 2023-03-25
      • 2021-10-09
      相关资源
      最近更新 更多