简体   繁体   中英

MKS Cannot connect to integrity client

I am trying to connect to MKS Integrity Client using sample code listed below

  try
  {
    IntegrationPointFactory ipf = IntegrationPointFactory.getInstance();
    CmdRunner cmdRunner = ipf.createLocalIntegrationPoint().getCommonSession()
                          .createCmdRunner();
    cmdRunner.setDefaultHostname("sslmmks1");
    cmdRunner.setDefaultPort(80);
    cmdRunner.setDefaultUsername("vmenon");
    cmdRunner.setDefaultPassword("Railsonfire1@3");

    Command issuesView = new Command(Command.IM, "issues");
    issuesView.addOption(
      new Option("fields","ID,Type,Summary"));
    issuesView.addOption(
      new Option("query", "Quick Query"));

    Response resp = cmdRunner.execute(issuesView);
    System.out.println(resp);
  } catch (Exception ex) {
    ex.printStackTrace();

  }

I am getting the following error

com.mks.api.response.ICLaunchException: Cannot connect to Integrity Client, the property IntegrityClient.launchOnDemand is not set to allow automatic launching. at com.mks.connect.ClientCmdRunnerImpl.icInitialize(Native Method) at com.mks.connect.ClientCmdRunnerImpl.checkIntegrityClientForLaunch (ClientCmdRunnerImpl.java:71) at com.mks.connect.ClientCmdRunnerImpl.executePreCondition(ClientCmdRunnerImpl.java:95) at com.mks.connect.AbstractCmdRunner.executeCommand(AbstractCmdRunner.java:235) at com.mks.connect.AbstractCmdRunner.execute(AbstractCmdRunner.java:394) at org.jpmc.mks.Mksmain.main(Mksmain.java:25)

You get this error because you don't have the Integrity Client running and you need to allow automatic launching in the IntegrationPoint.

Please update your code according to the following example:

IntegrationPointFactory ipf = IntegrationPointFactory.getInstance();
IntegrationPoint integrPoint = ipf.createLocalIntegrationPoint();
integrPoint.setAutoStartIntegrityClient(true);
CmdRunner cmdRunner = integrPoint.getCommonSession()
                      .createCmdRunner();

Also, please follow the Integrity Integrations Builder Guide (API) documentation available on your Integrity server (eg http://sslmmks1:80 )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM