Results 1 to 2 of 2
  1. #1
    shiva is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default unsupported protocol

    when im trying to execute it im getting the error as unsupported protocol ...im connecting to weblogic server.. pls help to resolve the error


    Exception in thread "main" java.net.MalformedURLException: Unsupported protocol: t3
    at javax.management.remote.JMXConnectorFactory.newJMX Connector(Unknown Source)
    at javax.management.remote.JMXConnectorFactory.connec t(Unknown Source)
    at ServerCon.main(ServerCon.java:35)




    Code:


    import java.util.Map;
    import javax.management.MBeanServerConnection;
    import javax.management.ObjectName;
    import javax.management.remote.JMXConnector;
    import javax.management.remote.JMXConnectorFactory;
    import javax.management.remote.JMXServiceURL;

    public class SimpleClientSecurity {

    public static void main(String[] args) throws Exception {

    //Update with your agent port
    int port = 7001;
    //Update with your agent host
    String host = "localhost";
    //Update with your agent url path
    String urlPath = "/jmxws";

    //Create JMX Agent URL
    JMXServiceURL url = new JMXServiceURL("ws", host, port, urlPath);

    System.out.println("Connecting with credentials.");
    Map<String, Object> env = new HashMap<String, Object>();
    String[] credentials = new String[]{"admin", "adminpassword"};
    env.put(JMXConnector.CREDENTIALS, credentials);

    //Connect providing credentials
    JMXConnector connector = JMXConnectorFactory.connect(url, env);

    //Get the MBeanServerConnection
    MBeanServerConnection connection = connector.getMBeanServerConnection();

    //getAttribute
    ObjectName mbeanName = new ObjectName(":type=Sample");

    String value = (String) connection.getAttribute(mbeanName, "Hello");

    System.out.println("Received : " + value);

    //close connection
    connector.close();

    System.out.println("Connection closed.");
    }
    }

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    6

Similar Threads

  1. x modem protocol
    By jithan in forum New To Java
    Replies: 0
    Last Post: 08-21-2008, 10:43 AM
  2. Replies: 0
    Last Post: 05-26-2008, 04:26 PM
  3. New Protocol?
    By lada.r in forum Networking
    Replies: 0
    Last Post: 11-06-2007, 09:13 PM
  4. Help with OSCAR protocol
    By lenny in forum Networking
    Replies: 1
    Last Post: 08-07-2007, 06:30 AM
  5. how to use SIP protocol
    By katie in forum Advanced Java
    Replies: 1
    Last Post: 08-06-2007, 10:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •