2017-06-01 57 views
0
public static void main(String[] args) throws 
FailingHttpStatusCodeException, MalformedURLException,IOException, 
InterruptedException { 

    final ActiveXComponent activeXComponent = new ActiveXComponent("CLSID:0CA54D3F-CEAE-48AF-9A2B-31909CB9515D"); 

    WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER); 
    webClient.getOptions().setThrowExceptionOnScriptError(false); 
    webClient.getOptions().setActiveXNative(true); 
    // https://pbsz.ebank.cmbchina.com/CmbBank_GenShell/UI/GenShellPC/Login/Login.aspx 
    HtmlPage page = webClient.getPage("https://pbsz.ebank.cmbchina.com/CmbBank_GenShell/UI/GenShellPC/Login/LoginOLD.aspx"); 
    System.out.println(page.asXml()); } 

enter image description here活動的HtmlUnit負載例外

異常線程 「main」 com.jacob.com.ComFailException:找不到綽號

我通過C:\Windows\System32\CMBEdit.dll Still not feasible

回答

0

更新:

這是雅各布的問題,因爲異常是:

Exception in thread "main" com.jacob.com.ComFailException: Can't find moniker 
    at com.jacob.com.Dispatch.createInstanceNative(Native Method) 
    at com.jacob.com.Dispatch.<init>(Dispatch.java:99) 
    at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58) 
    at test.test.JacobTest.main(JacobTest.java:24) 

爲另一answer暗示:

COM對象必須註冊才能被發現。 他們駐留的文件夾無關緊要。

的DLL調用

regsvr32 mycomdll.dll 

+0

這就是我所做的,但它並沒有幫助 – caoheike