Search code examples
javacom4jhp-quality-center

error while connecting to hp Quality Center using com4j


i m trying to connect to hp qc version 10.00 using com4j library in eclipse on Win7

I followed the following steps:

  • Created the wrapper for the OTAClient.dll using tlbimp.jar
  • Registered OTAClient.dll using regsvr32
  • Imported the OTAClient Wrapper in the program.
  • Imported com4j library.

Used the following code:

import ota.ClassFactory;
import ota.ITDConnection;

public class comqc {

    public static void main(String args[]){

        ITDConnection td = ClassFactory.createTDConnection();   
        td.initConnectionEx("https://qcbt10.saas.hp.com/qcbin/start_a.htm");
        System.out.println(td.connected()); 
        td.connectProjectEx(domain, project, username, password);             
        }
}

Getting the following output:

true
Exception in thread "main" com4j.ComException: 80000482 (Unknown error) : Invalid server response : .\invoke.cpp:517
at com4j.Wrapper.invoke(Wrapper.java:166)
at $Proxy5.connectProjectEx(Unknown Source)
at qctools.main(qctools.java:15)
Caused by: com4j.ComException: 80000482 (Unknown error) : Invalid server response : .\invoke.cpp:517
at com4j.Native.invoke(Native Method)
at com4j.StandardComMethod.invoke(StandardComMethod.java:42)
at com4j.Wrapper$InvocationThunk.call(Wrapper.java:335)
at com4j.Task.invoke(Task.java:51)
at com4j.ComThread.run0(ComThread.java:153)
at com4j.ComThread.run(ComThread.java:134)

What is it that is going wrong?


Solution

  • Try https://qcbt10.saas.hp.com/qcbin as connection target.

    There are quite a few examples in the OTA Reference (OTA_API_Reference.chm); although written in Basic, they should be easily translatable to Java.