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.

Close

ComFailException: Can't co-create an Object

2009-07-29
2013-05-20
  • Can any of you explain the possible reasons for getting this exception?

    com.jacob.com.ComFailException: 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
    Kumar

     
    • K Dal
      K Dal
      2009-09-01

      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:

      com.jacob.com.ComFailException: Can't co-create object 

      Does anyone have more information about causes of this exception?

      Thank you,
      K Dal

       
  • chipu
    chipu
    2011-10-19

    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
    2011-11-22

    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

    Thanks

     

  • Anonymous
    2011-11-22

    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

    Thanks

     
  • Katarina
    Katarina
    2012-03-23

    Hello,

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

     

  • Anonymous
    2012-03-30

    I didnt get any solution..

     

  • Anonymous
    2012-05-20

    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
    Jack_Jonhy
    2012-07-31

    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(
    documents,
    "Open",
    Dispatch.Method,
    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 {
    desPath,
    new Variant(DocumentConverterConstants.WORD_HTML_SIMPLE) },
    new int);

    Dispatch.call(doc, "Close", new Variant(false));
    } catch (Exception e) {
    logger.error(e.getMessage());
    } 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 wagnvipjian@163.com . I will appreciate it .