3 Replies Latest reply on Aug 25, 2004 11:04 AM by rramsara

    Upgrading to 3.2.5

    rramsara Newbie

      I've just upgraded by JBoss version from 3.2.1 to 3.2.5. I am running into a problem getting a remote reference to my MBean server. My original client code was

      Properties props = new Properties();
      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      props.put(Context.PROVIDER_URL, jnp://localhost:4902);
      InitialContext ctx = new InitialContext(props);
      String serverName = InetAddress.getLocalHost().getHostName();
      String connectorName = "jmx:" + serverName + ":rmi";
      (RMIAdaptor) ctx.lookup("connectorName");

      which worked. Now, I updated the client code to use 'jmx/rmi/RMIAdaptor' with 3.2.5:

      Properties props = new Properties();
      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      props.put(Context.PROVIDER_URL, jnp://localhost:4902);
      InitialContext ctx = new InitialContext(props);
      (RMIAdaptor) ctx.lookup("jmx/rmi/RMIAdaptor");

      But I get an exception on the lookup:

      org.jboss.jmx.adaptor.rmi.RMIAdaptorExt (no security manager: RMI class loader disabled)

      I tried setting the Java policy policy file in run.bat, but I get the same error...

      "%JAVA%" -Djava.security.policy=C:\Academy\update\policy.dat .....

      where policy.dat is
      grant {
      permission java.security.AllPermission;
      };


      What am I missing here?

      Thanks,
      Ravi

        • 1. Re: Upgrading to 3.2.5
          Joachim Van der Auwera Expert

          Are you sure you modified the JNP port number in 3.2.5?

          Joachim

          • 2. Re: Upgrading to 3.2.5
            rramsara Newbie

            Yes, I modified jboss-service.xml in the conf directory...

             <!-- ==================================================================== -->
             <!-- JNDI -->
             <!-- ==================================================================== -->
            
             <mbean code="org.jboss.naming.NamingService"
             name="jboss:service=Naming">
             <!-- The listening port for the bootstrap JNP service. Set this to -1
             to run the NamingService without the JNP invoker listening port.
             -->
             <attribute name="Port">4902</attribute> <!-- Change from 1099 -->
             <!-- The bootstrap JNP server bind address. This also sets the default
             RMI service bind address. Empty == all addresses
             -->
             <attribute name="BindAddress">${jboss.bind.address}</attribute>
             <!-- The port of the RMI naming service, 0 == anonymous -->
             <attribute name="RmiPort">0</attribute> <!-- Change from 1098 -->
             <!-- The RMI service bind address. Empty == all addresses
             -->
             <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
             </mbean>
            
             <mbean code="org.jboss.naming.JNDIView"
             name="jboss:service=JNDIView"
             xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml">
             </mbean>


            • 3. Re: Upgrading to 3.2.5
              rramsara Newbie

              Duh! So I figured out what was wrong - I just had to specify the direct path to my policy file for my client:

              -Djava.security.policy=C:\server.policy

              No server changes required. The client code is

              Properties props = new Properties();
              props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
              props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
              InitialContext ctx = new InitialContext(props);
              SecurityManager sm = System.getSecurityManager();
              if(sm == null)
              {
               sm = new RMISecurityManager();
               System.setSecurityManager(sm);
              }
              lRemoteServer = (RMIAdaptor) ctx.lookup(jnp://localhost:4902/jmx/rmi/RMIAdaptor);