Menu

ComFailException, trying to use jgd.comapi

Help
2007-09-25
2013-04-03
  • Martin Sjoblom

    Martin Sjoblom - 2007-09-25

    Hi!

    I have seen very few examples of usage of this terrific API.
    I have used the JGDQuery but would like to use the benefits of the jgd.comapi but with very little success. I have probably missed something BIG but Please bare with me.
    Could somone Please point this n00b into the direction of the "obvoious" solution

    The simple code:
         // It IS the correct path for the DLL
        ComponentRegistrator registrator = new ComponentRegistrator( "./lib/gdapi/x86/");

        // I get a warning which I think is normal (I shouldn't be doing this but the first time)
        // But I don't know how to detect if the component is registered.
        registrator.registerQueryComponent( registrator.getGUID());

        // constructs a new query (registration of GDAPI is
        // started if it's the first time) (Someone elses comment :-)
        QueryCOM query = new QueryCOM( "CBRN");

        // This query triggers the error stack, I have tried with 0, 20 but without any
        //  difference.
        QueryResultSet results = query.execute( 1, 20);

    Gives the uninformant (for me) message stack:
    [INFO] JGDRegister - compReg=jgd.comapi.ComponentRegistrator@18237215{jacobDLLPath=N:\dokument\Martin\Projekt\CBRN\SearchEngine\lib\gdapi\x86\, GUID={488A5393-D843-4f60-A357-68EC5BA63C92}}
    Exception in thread "main" com.jacob.com.ComFailException: Invoke of: Execute
    Source:
    Description:

        at com.jacob.com.Dispatch.invokev(Native Method)
        at com.jacob.com.Dispatch.invokev(Dispatch.java:945)
        at com.jacob.com.Dispatch.callN(Dispatch.java:558)
        at com.jacob.com.Dispatch.call(Dispatch.java:633)
        at com.jacob.activeX.ActiveXComponent.invoke(ActiveXComponent.java:534)
        at jgd.comapi.QueryCOM.execute(Unknown Source)
        at jgd.comapi.QueryCOM.execute(Unknown Source)

     
    • Maso Gato

      Maso Gato - 2007-09-25

      Hi Martin,
      I'm very sorry! It's absolutely true: there aren't examples and documentation enough.
      In the past we made an effort to write this code, but actually We are very busy and we have no time to do this.

      Please, check out the test class to see examples.
      http://gdapi.cvs.sourceforge.net/gdapi/gdapi2/tests/jdg/test/GDAPICOMTests.java?revision=1.3&view=markup

      I think that this class has all functionality available (included testRegistration).It is not too much, and there are problems in some of them.

      As you can see, JGDQuery is the unique interface.

      You are trying to use the api written and given by Arne Solheim (thanks Arne!), for be consumed by GDAPI.
      JGDQuery -> comapi -> Jacob project -> G. Desktop COM

      The problem is that you will not find more functionality with comapi.

      The error: It seems that G.DesktopCOM throws this error because you are trying to launch a query before you have registered.
      It is possible that you are using comapi incorrectly

      Hope that this helps you.
      Thank you very much for use GDAPI,
      - Maso Gato

       

Log in to post a comment.

MongoDB Logo MongoDB