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.

Like,

Context ctx = new InitialContext();

Comments

  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

    ReplyDelete

Post a Comment

Popular posts from this blog

Difference between volatile and synchronized

Converting Java Map to String

Masking Credit Card number in Java