日期:2014-05-20  浏览次数:20996 次

使用jacob出现异常com.jacob.com.ComFailException: Invoke of: AddValue

多个线程同时访问ActiveXComponent .invoke("AddValue", this.msDataValue[i]);时出现异常,请问怎么解决?


Java code

2012-4-16 16:49:26 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
com.jacob.com.ComFailException: Invoke of: AddValue
Source: 
Description: 

    at com.jacob.com.Dispatch.invokev(Native Method)
    at com.jacob.com.Dispatch.invokev(Dispatch.java:630)
    at com.jacob.com.Dispatch.callN(Dispatch.java:453)
    at com.jacob.com.Dispatch.call(Dispatch.java:541)
    at com.jacob.activeX.ActiveXComponent.invoke(ActiveXComponent.java:402)
    at com.aastocks.core.TradeDataHandler.setMsgParams(TradeDataHandler.java:71)
    at com.aastocks.core.TradeDataHandler.requestData(TradeDataHandler.java:130)
    at com.aastocks.servlet.ClienHandlerServlet.loginHandler(ClienHandlerServlet.java:96)
    at com.aastocks.servlet.ClienHandlerServlet.doPost(ClienHandlerServlet.java:59)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at com.aastocks.core.FilterServlet.doFilter(FilterServlet.java:56)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
    at java.lang.Thread.run(Thread.java:619)




------解决方案--------------------
请问解决了吗?我和你一样,多线程访问报错,就是这个错误