Friday, April 25, 2008

Invoking EJB deployed on a remote machine

Invoking EJB deployed on a remote machine
In case we are calling remote ejb( ejb deployed on remote machines),
The JNDI lookup might lookup like,
Properties env = new Properties();
            env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
            env.put(Context.PROVIDER_URL, "XX.XXX.XX.XX:1099");   
            env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); 
            Context ctx = new InitialContext(env);

If we are calling local ejb then we can simply create InitialContext without any parameters.


Context ctx = new InitialContext();

1 comment :

  1. Good post. I learn something totally new and challenging on blogs I stumbleupon on a daily basis.
    It's always useful to read articles from other authors
    and practice something from other web sites.

    My web-site :: descargar whatsapp para pc