11 Replies Latest reply on Nov 16, 2007 6:23 PM by Ian Nelson

    Help with simple sample setup.

    Ian Nelson Newbie

      I'm running the example from http://wiki.jboss.org/wiki/Wiki.jsp?page=JMXMBeanRemoteProxy
      but whenever my clients try to connect they cannot find the object in the JNDI registry.

      When I do a "/usr/local/jboss/bin/twiddle.sh --server=10.140.0.190:1099 serverinfo --list" I see the new InvokeTarget listed:

      jboss.management.local:ServiceModule=foo.sar,name=jboss.jmx%3atype%3dadaptor%2cname%3dMyServiceInvokeTarget%2cprotocol%3djrmp%2cservice%3dproxyFactory,J2EEServer=Local,J2EEApplication=null,j2eeType=MBean
      jboss.jmx:type=adaptor,name=MyServiceInvokeTarget,protocol=jrmp,service=proxyFactory


      but when my client code tries to connect to it, it always fails to look it up. Here is the client code:

      try {
      Hashtable<String,String> environment = new Hashtable<String,String>();
      environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      environment.put(Context.PROVIDER_URL, "jnp://10.140.0.190:1099"); // remote machine IP
      InitialContext ic = new InitialContext( environment );
      MyServiceMBean myService = (MyServiceMBean)ic.lookup("MyService");
      } catch( Exception e ) {
      log.error("exception: " + e);
      }



      I'm sure there is something stupid I'm seeing or doing. I'm running on Jboss 4.2 with a fairly stock default like server.

      thanks for any suggestions.