1 Reply Latest reply on May 7, 2003 6:05 AM by Fabiano C. de Oliveira

    Connect to MBean from applet via RMI??

    Kasper Newbie

      Hi
      I just don't get this. I had searched this forum, bought the documentation, but still I can't get an connection to the jmx via rmi.
      This is my last try:

      java.util.Properties props=new java.util.Properties(); props.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
      props.put("java.naming.provider.url",rmiAddres);
      javax.naming.InitialContext ic = new javax.naming.InitialContext(props);

      org.jboss.jmx.adaptor.rmi.RMIAdaptor adaptor = (org.jboss.jmx.adaptor.rmi.RMIAdaptor) ic.lookup(adaptorName);
      output+="Adaptor ="+adaptor;

      org.jboss.jmx.connector.RemoteMBeanServer server = new org.jboss.jmx.connector.rmi.RMIConnectorImpl(adaptor);
      output+="\n remoteMBeanServer = "+server.toString();
      Integer count = server.getMBeanCount();
      output+="\n count = "+count;
      String domain = server.getDefaultDomain();
      output+="\n domain = "+domain;
      java.util.Set set = server.queryMBeans(new javax.management.ObjectName("jboss:service=JNDIView"),null);
      output+="\n set = "+set;

      Here I get an access denied (java.net.SocketPermission 230.0.0.4 connect,accept,resolve error)

      Can anybody tell me what I do wrong or guide me to an example.
      (I am running jboss 3.2 tomcat 4.1.24 and j2sdk1.4.1_01 on unix)

      Thanks in advantage
      Kasper