MKS无法连接到完整性客户端

时间:2018-03-07 10:15:30

标签: java api mks

我正在尝试使用下面列出的示例代码连接到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   客户端,属性IntegrityClient.launchOnDemand未设置为   允许自动启动。在   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)   在   com.mks.connect.AbstractCmdRunner.executeCommand(AbstractCmdRunner.java:235)   在   com.mks.connect.AbstractCmdRunner.execute(AbstractCmdRunner.java:394)   在org.jpmc.mks.Mksmain.main(Mksmain.java:25)

1 个答案:

答案 0 :(得分:0)

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

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

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

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