4 Replies Latest reply on Oct 26, 2006 5:08 PM by 3004

    Error while trying to connect to weblogic from remote client

    666705
      Hi

      I was trying to connect to JMX MBeanserver from a aremote client using some sample code that was posted. Ive tried even the samples that I found in the Admin Guide itself. Im not certain if any server configuration is needed. Ive tried the below with all three protocols t3, iiop, http with the same result. I had also enabled IIOP on the server through the console.

      I get an error when trying to conenct using the JMXConnection Factory i.e. at the last line of the following code:


      String protocol = "t3"; // can be t3, http, iiop
      String hostname = "santapoco.eng";
      int port = 7001;
      String uri = "/jndi/"+"weblogic.management.mbeanservers.runtime";

      JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port, uri);

      Hashtable h = new Hashtable();
      h.put(Context.SECURITY_PRINCIPAL, "weblogic");
      h.put(Context.SECURITY_CREDENTIALS, "weblogic");
           h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
      JMXConnector connector =JMXConnectorFactory.connect(serviceURL, h);


      The error is:

      "Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
           java.io.EOFException]
           at weblogic.jrmp.Context.lookup(Context.java:189)"
        • 1. Re: Error while trying to connect to weblogic from remote client
          666705
          NOTE this was with weblogic 91
          • 2. Re: Error while trying to connect to weblogic from remote client
            3004
            Pratima Gogineni <> writes:


            This is what worked for me:


            URI uri = new URI(args[0]);
            JMXServiceURL serviceURL =
            new JMXServiceURL(uri.getScheme(), uri.getHost(), uri.getPort(),
            "/jndi/weblogic/management/mbeanservers/runtime");

            Hashtable h = new Hashtable();
            h.put(Context.SECURITY_PRINCIPAL, "system");
            h.put(Context.SECURITY_CREDENTIALS, "ejb2come");
            // String[] jmxCredentials = new String[]{ "system", "ejb2come" };
            // h.put(JMXConnector.CREDENTIALS, jmxCredentials);
            h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
            "weblogic.management.remote");
            h.put(Context.PROVIDER_URL, args[0]);
            // h.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
            h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
            // InitialContext ic = new InitialContext(h);
            // ic.lookup("weblogic/management");
            JMXConnector connector = JMXConnectorFactory.connect(serviceURL, h);
            MBeanServerConnection connection = connector.getMBeanServerConnection();



            NOTE this was with weblogic 91
            --
            • 3. Re: Error while trying to connect to weblogic from remote client
              666705
              I've tried to connect to Weblogic usign the example you've posted, but I've this exception

              Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: <b>Cannot instantiate class: weblogic.jndi.WLInitialContextFactory</b> [Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory]
                   at javax.manage
              • 4. Re: Error while trying to connect to weblogic from remote client
                3004
                l l <> writes:


                I would guess you don't have the class in your client


                andy



                I've tried to connect to Weblogic usign the example you've posted, but I've this exception

                Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: <b>Cannot instantiate class: weblogic.jndi.WLInitialContextFactory</b> [Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory]
                     at javax.manage