Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public static void main(String[] args) throws Exception {
  2. String serverName = "AdminServer";
  3. String hostName = "127.0.0.1";
  4. String username = "";
  5. String password = "";
  6. int port = 7001;
  7. String protocol = "t3";
  8. String jndiroot = "/jndi/";
  9. String mserver = "weblogic.management.mbeanservers.domainruntime";
  10. JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostName, port, jndiroot + mserver);
  11. Hashtable h = new Hashtable();
  12. h.put(Context.SECURITY_PRINCIPAL, username);
  13. h.put(Context.SECURITY_CREDENTIALS, password);
  14. h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
  15. JMXConnector connector = JMXConnectorFactory.connect(serviceURL, h);
  16. ObjectName objName = new ObjectName("com.bea:Name=" + serverName + ",Type=Server");
  17. String pathJKS = (String) connector.getMBeanServerConnection().getAttribute(objName, "CustomTrustKeyStoreFileName");
  18. System.out.println(pathJKS);
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement