Menu

ComFailException - Can't co-create object

Help
2008-03-26
2013-04-03
  • Carlos S. Zamudio

    Hi,
    I'm having an interesting problem.  I can successfully call the GDAPI and perform a google search on my desktop. I find the DLL, I get the dialog asking confirmation of registration, etc. But only once. 

    JGDQuery googleQuery = new JGDQuery("simple");
    SearchKeyUtilities.googleDesktopQuery.setNum(MAX_HITS );
    Results results = SearchKeyUtilities.googleDesktopQuery.execute();
    ...

    When I call perform this in a loop, I get the following Jacob error:
    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:101)
        at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58)
        at jgd.comapi.QueryCOM.execute(Unknown Source)
        at jgd.comapi.QueryCOM.execute(Unknown Source)
        at jgd.JGDQuery.execute(Unknown Source)

    I have found some discussion around this type of error in JACOB threads, but no clear suggestions.

    Any suggestions?
    Thanks,
    Carlos S. Zamudio

     
    • Carlos S. Zamudio

      Interesting. I discovered that JACOB doesn't seem to operate well in a multi-threaded application.  So, I solved this problem by making sure only one thread was performing a search at one time.

       

Log in to post a comment.

MongoDB Logo MongoDB