tags:

views:

214

answers:

1

Hi Everyone,

I am trying to access some objects using JNDI from an external JVM in Atg Dyanmo Application Server. I am using the following code -

    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;

    public class URLTest {

    public static Object getNamedObject() {
    Object o = null;
    Hashtable env = new Hashtable();

    env.put(Context.INITIAL_CONTEXT_FACTORY, "atg.jndi.url.dynamoejb.RemoteEJBContext");
    env.put(Context.URL_PKG_PREFIXES, "atg.jndi.url.dynamoejb ");

    env.put(Context.PROVIDER_URL, "rmi://10.112.83.203:8860");

    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "admin");

    try
    {
    Context ctx = new InitialContext(env);
    System.out.println("Got Context - " + ctx);

    o = ctx.lookup("dynamo:/pearsonpoc/beans/UserInformation");
    System.out.println("Lookup success  - " + o);
}
    catch (Exception e) {
    System.out.println("ERR - " + e);
    }

    return o;
    }
    }

When I am running this code at the same jvm, it works fine, but when I am trying this from other jvm it does not work. Rmi server is running on the port 8860. Is there any setting on server which basically stop requests from clients? This is the exception i am getting -

09:46:25,963 INFO [STDOUT] Got Context - javax.naming.InitialContext@e3a921 09:46:26,010 INFO [STDOUT] ERR - javax.naming.NameNotFoundException: dynamo:/pearsonpoc/beans/UserInformation 09:46:26,010 INFO [STDOUT] Result - null

Please help. Thanks

A: 

You need to export the service on the server.

make this change to. /atg/dynamo/server/RmiServer.properties

exportedServices+=/pearsonpoc/beans/UserInformation

Andrew Goldfinch