连接考勤机的时候报错 创建ZkemSDK 失败
Exception in thread "Thread-3"
java.lang.ExceptionInInitializerError
at cn.webro.callcom.CourseAction.run(CourseAction.java:17)
Caused by: 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 com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58)
at cn.webro.callcom.ZkemSDK.<clinit>(ZkemSDK.java:14)
... 1 more
at cn.webro.callcom.CourseAction.run(CourseAction.java:17)
ZkemSDK sdk = new ZkemSDK();
完整的
package cn.webro.callcom;
import org.nutz.ioc.Ioc;
import org.nutz.ioc.IocException;
import org.nutz.ioc.impl.PropertiesProxy;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.Mvcs;
import cn.webro.callcom.ZkemSDK;
@IocBean
public class CourseAction extends Thread{
Ioc ioc = Mvcs.ctx().getDefaultIoc();
final PropertiesProxy conf=ioc.get(PropertiesProxy.class,"conf");
@Override
public void run() {
try {
ZkemSDK sdk = new ZkemSDK();
//String deviceIp = "192.168.1.202";
String deviceIp=conf.get("deviceIp");
//String deviceIp = "192.168.1.201";
boolean connFlag = sdk.connect(deviceIp, 4370);
if (connFlag) {
sdk.regEvent(deviceIp);
//sdk.connect("192.168.1.201", 4370); // 如果是程序调用的这里能监控到OnConnected 事件
//System.out.println("202");
} else {
connFlag = sdk.connect(deviceIp, 4370);
System.out.println("连接失败");
}
} catch (IocException e) {
e.printStackTrace();
}
}
}
at cn.webro.callcom.ZkemSDK.(ZkemSDK.java:14)
private static ActiveXComponent zkem = new ActiveXComponent("zkemkeeper.ZKEM.1");