Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


ComFailException: Can't co-create an Object

  • Can any of you explain the possible reasons for getting this exception? Can't co-create object

    This is when Java tries to initialize acrobat using the below code

    ActiveXComponent myAcroApp;

        myAcroApp = new ActiveXComponent("AcroExch.App");

    The same works initially when the PDF Window opens. But after some transactions, the method will be called from different prospect which gives the above exception.

    Thanks in Advance

    • K Dal
      K Dal

      Have you learned anything new about this exception?

      I have a similar issue.  I'm using Jacob 1.14, and Java jre1.6.0_07.  My program runs on a Coldfusion server as a scheduled task using java.  I interface with a third party API dll to pull information from their server over to ours when the scheduled task runs.  I wrap all my Jacob calls with COM Thread object initSTA and release calls, to make sure the memory is being released.  I also use locks to make sure that only one user is able to call the jacob code at once.

      Everything performs just fine for awhile, but within roughly 24 hours (the timing isn't the same every day), or roughly 100 calls to my Jacob code, I suddenly start getting that same error when I try to instantiate the activeX object from that point forward: Can't co-create object 

      Does anyone have more information about causes of this exception?

      Thank you,
      K Dal

  • chipu

    Did you finde the cause of the problem?
    I am using jacob to talk to outlook, and I am facing the very exact problem


  • Anonymous

    Do you finally found what was the problem?
    I am having exactly the same issue, with java 6 (many versions), jacob 1.15M4 and working with MS Outlook



  • Anonymous

    Do you finally found what was the problem?
    I am having exactly the same issue, with java 6 (many versions), jacob 1.15M4 and working with MS Outlook


  • Katarina


    I am fasing the same issue. Anybody found solution yet? Thank you.


  • Anonymous

    I didnt get any solution..


  • Anonymous

    I found my issue was a really obscure bug that caused a rare unhandled exception in the constructor method of the COM object. Interesting that sometimes it caused a "Can't co-create object" and sometimes a JVM crash.

    I deleted the bug tracker but it still shows up as "deleted" :\

  • Jack_Jonhy

    I got  the nearly same problem in my java application .  After the scheduled task  worked fine more than two weeks, it happened  suddently .
    public static void convertWordToHtml(String srcPath, String desPath)
    throws JacobException {

    ActiveXComponent wordApp = new ActiveXComponent("Word.Application");

    try {
    wordApp.setProperty("Visible", new Variant(false));

    Dispatch documents = wordApp.getProperty("Documents").toDispatch();

    Dispatch doc = Dispatch.invoke(
    new Object { srcPath, new Variant(false),
    new Variant(true) }, new int).toDispatch();

    Object webOption = Dispatch.get(doc, "WebOptions").toDispatch();

    Variant varent = new Variant("65001");
    Dispatch.put((Dispatch) webOption, "Encoding", varent);

    Dispatch.invoke(doc, "SaveAs", Dispatch.Method, new Object {
    new Variant(DocumentConverterConstants.WORD_HTML_SIMPLE) },
    new int);, "Close", new Variant(false));
    } catch (Exception e) {
    } finally {

    wordApp.invoke("Quit", new Variant {});

    I gooled  on the internet and  until now i havn't got any solutions ! Any suggestion is welcome  abt it . If u have any solution plz inform me with . I will appreciate it .