[jboss-user] [JNDI/Naming/Network] - Help with simple sample setup.

TheNelson do-not-reply at jboss.com
Thu Nov 15 16:42:52 EST 2007


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.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105230#4105230

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105230



More information about the jboss-user mailing list