鍍金池/ 問答/Java  網絡安全  HTML/ 訪問Weblogic管理實體遇到weblogic.management.NoAc

訪問Weblogic管理實體遇到weblogic.management.NoAccessRuntimeException。

問題描述

訪問weblogic.management.mbeanservers.domainruntime失敗:

weblogic.management.NoAccessRuntimeException: [Management:141102]Subject: principals=[] does not have access to perform Admin actions.

問題出現的環(huán)境背景及自己嘗試過哪些方法

參考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

2018年6月15日 15:46