Reputation: 31
I Added a code to connect and create a defect in HP ALM
through Eclipse(Java) in which it communicates OTAClient and com4j.jar. I successfully able to connect and create a defect in 32 Bit OS but i couldn't able to connect it on 64 bit based OS.
I walkaround some of the solutions posted here and even though following the solution successfully i couldn't achieve a solution. [1]: com4j on Windows 64 bit ..
Here is My Code
import com.ClassFactory;
import com.IBug;
import com.IBugFactory;
import com.ITDConnection;
import com4j.Variant;
public class AlmQc {
public static void main(String args[])
{
login();
}
public static void createDefect(ITDConnection connection) {
IBugFactory bugFactory = (IBugFactory) connection.bugFactory().queryInterface(IBugFactory.class);
IBug bug = (bugFactory.addItem(new Variant(Variant.Type.VT_NULL))).queryInterface(IBug.class);
bug.assignedTo("Administrator");
bug.detectedBy("Administrator");
bug.status("New");
bug.project("Banking");
bug.summary("Created by Esh");
//bug.priority("Low");
bug.field("BG_SEVERITY", "2-Medium");
bug.field("BG_DETECTION_DATE", "2016-01-27 00:00:00");
bug.post();
}
public static void login()
{
String url = "http://almqc:8080/qcbin";
String username = "Administrator";
String password = "********";
String domain = "DEFAULT";
String project = "Banking";
ITDConnection itdc = ClassFactory.createTDConnection();
itdc.initConnectionEx(url);
itdc.connectProjectEx(domain, project, username, password);
System.out.println(itdc.projectConnected());
createDefect(itdc);
}
While running above code in eclipse i encountered following error.
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.mercury.qualitycenter.otaclient.ClassFactory.createTDConnection(Unknown Source)
at Sample.main(Sample.java:18)
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)
Please provide any walkaround or solution who got successfully executed on 64 bit Based OS.
Upvotes: 2
Views: 2343
Reputation: 23
The issue is not with 64 bit OS but with 64 bit JRE. If you are using IDE, point your JRE library (build path) to a 32 bit JRE (bin folder) else you can also install 32 bit JRE in 64 bit machines and run in that environment
Upvotes: 1
Reputation: 821
OTAClient is pure windows dll, even though you are using java you need to register it on windows machine. Better approach to get most out of it is to use it with .net, in such cases you can create windows/web service exposed over http. With this service you can develop c# code to do operations with OTAClient.dll. Using web/rest/wcf service you can communicate with the developed service. Gr8 part of it is it allows you to run over 64-bit architecture. IIS also allows with option "Enable 32-bit application" at application pool level.
Upvotes: 0
Reputation: 1105
You'll have to make a 32-bit version of your program that can use the 32-bit version of OTACLIENT.DLL. I'm not aware of a 64-bit version of OTACLIENT.DLL.
Upvotes: 1