1 Reply Latest reply on Sep 3, 2008 11:25 AM by justkeys

    How to define HAJNDI

      I want to cluster a User object among all server. I know HAJNDI can do that but how to define the user object inside cluster wide context and get it back from jndi lookup?

      I just saw the following code in the documentation. How about define it?
      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
      p.put(Context.PROVIDER_URL, "localhost:1100"); // HA-JNDI port.
      return new InitialContext(p);

        • 1. Re: How to define HAJNDI
          justkeys

          Just like any ejb in jboss: Annotate the service pojo com.my.Thing with @Service and @Remote(ThingRemote.class), and a (ThingRemote) can be found in that jndi under the name "Thing/remote".