Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws Exception {
- String serverName = "AdminServer";
- String hostName = "127.0.0.1";
- String username = "";
- String password = "";
- int port = 7001;
- String protocol = "t3";
- String jndiroot = "/jndi/";
- String mserver = "weblogic.management.mbeanservers.domainruntime";
- JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostName, port, jndiroot + mserver);
- Hashtable h = new Hashtable();
- h.put(Context.SECURITY_PRINCIPAL, username);
- h.put(Context.SECURITY_CREDENTIALS, password);
- h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
- JMXConnector connector = JMXConnectorFactory.connect(serviceURL, h);
- ObjectName objName = new ObjectName("com.bea:Name=" + serverName + ",Type=Server");
- String pathJKS = (String) connector.getMBeanServerConnection().getAttribute(objName, "CustomTrustKeyStoreFileName");
- System.out.println(pathJKS);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement