开发者社区> 问答> 正文

JACOB调用报错:Can't co-create object? 400 报错

JACOB调用报错:Can't co-create object? 400 报错

window64位服务器,在myeclipse里调用jacob出错,用的是jacob-1.17-M2-x64.dll

代码:

import com.jacob.com.Dispatch;


public class jacobtest {


public static void main(String[] args) {
// TODO Auto-generated method stub
String result = "";
System.out.println(System.getProperty("java.library.path"));
try {
Dispatch ids = new Dispatch("MailServerCtrl.MailDBInterface");

//Set Winmail database path
Object[] param1 = new Object[]{"E:\\Magic WinMail\\server"};

Dispatch.call(ids, "InitControl", param1);


//Add new mail user
Object[] param2 = new Object[]{"testtest", "jinying.com", "Mail123"};
result = String.valueOf(Dispatch.call(ids, "AddUser", param2));

System.out.println("result: "+result);
ids.safeRelease();
}
catch(Exception e) 
{
e.printStackTrace();
}
}


}


报错信息:com.jacob.com.ComFailException: Can't co-create object
at com.jacob.com.Dispatch.createInstanceNative(Native Method)
at com.jacob.com.Dispatch.<init>(Dispatch.java:99)
at weaver.interfaces.winmail.jacobtest.main(jacobtest.java:12)


展开
收起
爱吃鱼的程序员 2020-05-31 00:05:27 819 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    求教!######

    解决了吗

    2020-05-31 00:05:28
    赞同 展开评论 打赏
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Customer Success Dashboard GoD 立即下载
OPEN SOURCE IN A DATA-DRIVEN WORLD 立即下载
Java8简明教...[fredwong].1494561200.pdf 立即下载