0

我正在尝试使用下面列出的示例代码连接到 MKS Integrity Client

  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();

  }

我收到以下错误

com.mks.api.response.ICLaunchException:无法连接到 Integrity Client,属性 IntegrityClient.launchOnDemand 未设置为允许自动启动。在 com.mks.connect.ClientCmdRunnerImpl.icInitialize(Native Method) 在 com.mks.connect.ClientCmdRunnerImpl.checkIntegrityClientForLaunch (ClientCmdRunnerImpl.java:71) 在 com.mks.connect.ClientCmdRunnerImpl.executePreCondition(ClientCmdRunnerImpl.java:95) 在 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)

4

1 回答 1

0

您收到此错误是因为您没有运行 Integrity Client,并且您需要允许在 IntegrationPoint 中自动启动。

请根据以下示例更新您的代码:

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

此外,请遵循 Integrity 服务器上提供的Integrity Integrations Builder Guide (API)文档(例如http://sslmmks1:80

于 2018-04-16T07:56:09.297 回答