title: Unable to connect to HP Quality Center using Com4j
body: <p>OTAClient.dll version 10.0.0.2532</p>
  
  <p>The following is the code I have used to connect to qc, apply filter and fetch qcpath and a field data. It is working fine with java 32 bit version 1.7.  </p>
  
  <pre><code>   import com.oracle.qcTasks.ClassFactory;
     import com.oracle.qcTasks.IList;
     import com.oracle.qcTasks.ISubjectNode;
     import com.oracle.qcTasks.ITDConnection;
     import com.oracle.qcTasks.ITDFilter;
     import com.oracle.qcTasks.ITest;
     import com.oracle.qcTasks.ITestFactory;
     import com4j.Com4jObject;
  
     public class qcClient {
  
     public static void main(String[] args) {
  
      ITest qcTestCase;
      ISubjectNode qcTestCasePath;
      Com4jObject SubjectField;
      //QC url
      String url = "http://fusionqc.us.oracle.com/";
      //username for login
      String username = "username";
      //password for login
      String password = "";
      //domain
      String domain = "domain";
      //project
      String project = "project";
      ITDConnection itdc = ClassFactory.createTDConnection();
      itdc.initConnectionEx(url);
      itdc.connectProjectEx(domain, project, username, password);
      boolean flag = itdc.connected();
  
      System.out.println(itdc.projectName());     
      ITestFactory qcTestFactory = itdc.testFactory().queryInterface(ITestFactory.class);
      ITDFilter qcFilter=qcTestFactory.filter().queryInterface(ITDFilter.class);      
  
  
      String query="^Subject\\path^";         
      qcFilter.clear();
  
      qcFilter.filter("TS_SUBJECT", query);       
  
      IList qcTestList = qcFilter.newList();      
      for (Com4jObject com4jObject : qcTestList) {
          qcTestCase = com4jObject.queryInterface(ITest.class);
          System.out.println(qcTestCase.name());
          System.out.println(qcTestCase.field("TS_USER_09"));
  
  
          SubjectField = (Com4jObject)qcTestCase.field("TS_SUBJECT");
          qcTestCasePath = SubjectField.queryInterface(ISubjectNode.class);
          System.out.println(qcTestCasePath.path());
          break;
      }
  
  
      System.out.println("command output :: "+flag);
  
      System.out.println("OUT");      
      itdc.disconnectProject();
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>To the project requirement, I've downgraded the version of java to 64 bit version of 1.6. Post the downgrade, I'm receiving the following error.</p>
  
  <pre><code>      Exception in thread "main" com4j.ExecutionException: com4j.ComException: 80040154 CoCreateInstance failed : Class not registered : .\com4j.cpp:153
  at com4j.ComThread.execute(ComThread.java:203)
  at com4j.Task.execute(Task.java:25)
  at com4j.COM4J.createInstance(COM4J.java:97)
  at com4j.COM4J.createInstance(COM4J.java:72)
  at com.oracle.qcTasks.ClassFactory.createTDConnection(ClassFactory.java:16)
  at com.oracle.qcCode.qcClient.main(qcClient.java:32)
        Caused by: com4j.ComException: 80040154 CoCreateInstance failed : Class not registered : .\com4j.cpp:153
  at com4j.Native.createInstance(Native Method)
  at com4j.COM4J$CreateInstanceTask.call(COM4J.java:117)
  at com4j.COM4J$CreateInstanceTask.call(COM4J.java:104)
  at com4j.Task.invoke(Task.java:51)
  at com4j.ComThread.run0(ComThread.java:153)
  at com4j.ComThread.run(ComThread.java:134)
  </code></pre>
  
  <p>I've found similar threads but didn't found any particular solution for the same. Please help. Is there any impact wrt java versions</p>