问题描述
访问weblogic.management.mbeanservers.domainruntime失败:
weblogic.management.NoAccessRuntimeException: [Management:141102]Subject: principals=[] does not have access to perform Admin actions.
问题出现的环境背景及自己尝试过哪些方法
参考How it’s done: Password change functionality in OBIEE
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
初始化连接方法如下:
public static void InlCctn(String Adr, String AdrUsr, String AdrPswd) throws IOException, MalformedURLException {
JMXServiceURL SvcUrl =
new JMXServiceURL("service:jmx:iiop://" + Adr + "/jndi/weblogic.management.mbeanservers.domainruntime");
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
h.put(Context.SECURITY_PRINCIPAL, AdrUsr);
h.put(Context.SECURITY_CREDENTIALS, AdrPswd);
// String[] credentials = new String[] { AdrUsr, AdrPswd };
// h.put("jmx.remote.credentials", credentials);
cctor = JMXConnectorFactory.connect(SvcUrl, h);
mbsc = cctor.getMBeanServerConnection();
}
用了两种方式连接都是同样的报错。
期待
到底是Weblogic配置问题,还是我方法的问题?
方法构造问题,请参考Accessing WebLogic Server MBeans with JMX