2 Replies Latest reply on May 12, 2004 3:53 AM by anil_gv

    RMI Ojbect Binding Problem in JNDI

    anil_gv Newbie

      I am binding the RMI Object to JNDI using context. I am able to bind the RMI object
      Immediately after bind if I force GC() object is getting destroyed(Finalize method of RMI object is been called).

      Since the object is destroyed, if I do lookup on RMI object it is throwing exception.

      Same code I tried with other Application Server (Weblogic). It is working fine, I mean object is not destroyed; if I do look up it is returning the RMI Object reference.

      Pl any one tell me, any configuration is required in Jboss. Or what is the solution / workaround for this problem.

        • 1. Re: RMI Ojbect Binding Problem in JNDI
          Adrian Brock Master

          Show how/what you bind.
          It can only be garbage collected if it is not referenced by something.

          • 2. Re: RMI Ojbect Binding Problem in JNDI
            anil_gv Newbie

            Following method creates context.
            using the context i will call Context.rebind() / Context.bind() method.

            public static Context getInitialContextJBoss() throws Exception {

            String url = "jnp://localhost:1099";

            String user = null;
            String password = null;
            Properties properties = null;
            try {
            properties = new Properties();
            properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

            properties.put(Context.PROVIDER_URL, url);
            if (user != null) {
            properties.put(Context.SECURITY_PRINCIPAL, user);
            properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);

            return new InitialContext(properties);
            catch(Exception e) {
            throw e;