Question

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?

Was it helpful?

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.

OTHER TIPS

The first thing I was doing wrong was the URL, I was using
"https://qcbt10.saas.hp.com/qcbin/start_a.htm" whereas i had to use
"https://qcbt10.saas.hp.com/qcbin" just as the above answer! but after doing that, the program ran! but the JRE crashed at runtime with the message "Java(TM) Platform SE binary has stopped working".. This was solved by using the "BugFactory" in my program! I dont know how it worked and why it didn't work earlier, but as soon as I used BugFactory in any of my statements, the crash stopped! for eg,

IBugFactory bugfactory = td.bugFactory().queryInterface(IBugFactory.class);

this statement did the trick! still the actual problem was solved by using the correct URL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top