WebSphere Liberty - поиск JNDI завершается неудачно - PullRequest
0 голосов
/ 18 марта 2019

Я использую Websphere Liberty. У меня возникает проблема, когда я пытаюсь получить доступ к jndiEntry. Коды под поиском не выполняются / server.xml:

<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
    <featureManager>
        <feature>webProfile-8.0</feature>
        <feature>jndi-1.0</feature>
        <feature>ejbRemote-3.2</feature>
        <feature>localConnector-1.0</feature>
        <feature>adminCenter-1.0</feature>
    </featureManager>

    <httpEndpoint id="defaultHttpEndpoint"
                  httpPort="9080"
                  httpsPort="9443" />

    <applicationManager autoExpand="true"/>

    <jndiEntry jndiName="schoolOfAthens/defaultAdminUserName" value='"plato"' />

    <iiopEndpoint iiopPort="2809" id="defaultIiopEndpoint">
         <iiopsOptions iiopsPort="2810"></iiopsOptions>
     </iiopEndpoint>
     <orb nameService="corbaname::localhost:2809" iiopEndpointRef="defaultIiopEndpoint">
     </orb>

    <remoteFileAccess>
    <writeDir>${server.config.dir}</writeDir>
    </remoteFileAccess>

    <logging consoleLogLevel="INFO" />
</server>

Я пытаюсь получить доступ к jndiEntry из кода клиента:

package com.ibm.test;
import javax.naming.*;

import java.util.*;

public class myTest {

 public static void main( String args[]) {
  try{
      InitialContext ctx = new InitialContext();
      Object object = ctx.lookup("schoolOfAthens/defaultAdminUserName");
      System.out.println("object: ");
  } catch (Exception e){
    e.printStackTrace();
  }
 }
}

Когда я запускаю программу, строки под поиском не выполняются.

Я использую следующие банки: 1. ejbRemotePortable.jar 2. com.ibm.ws.ejb.thinclient_9.0.jar 3. com.ibm.ws.orb_9.0.jar

...