Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hi,
We are using Integrity Client 11.0.0.506 and Java API 4.16.506
When executing the SI projectco command it throws "com.mks.api.response.CommandException"
which unfortunately contains no obvious useful fields about the error
I would expect to know if the member is not found or if access to member is denied
The exception's getMessage() and getLocalizedMessage() methods returns null.
Also if I serialize the exception to string I get nothing, the result is ""
StringWriter stringWriter = new StringWriter();
ex.printStackTrace(new PrintWriter(stringWriter));
String details = stringWriter.toString();
Can someone provide some hints ?
IntegrationPointFactory factory = IntegrationPointFactory.getInstance();
IntegrationPoint integrationPoint = factory.createLocalIntegrationPoint(APIVersion.API_4_16);
integrationPoint.setAutoStartIntegrityClient(true);
Session session = integrationPoint.getCommonSession();
CmdRunner cmdRunner = this.session.createCmdRunner();
cmdRunner.setDefaultUsername("userNameX");
cmdRunner.setDefaultHostname("hostNameX");
cmdRunner.setDefaultPort(portNumber);
Command cmd = new Command(Command.SI,"projectco");
cmd.addOption(new Option("project","....project path"));
cmd.addSelection(new Option("overwriteExisting"));
cmd.addSelection(new Option("nolock"));
cmd.addOption(new Option("targetfile","c:\\temp\\abc.txt"));
cmd.addSelection("fileMember.txt");
Response response = cmdRunner.execute(cmd);
I can spot a few problems in your code.
I have attached sample command for si viewproject. It tries to be as bare-bones as possible but should give you an indication if your API connections are working. It should output a list of projects on the system. You only need to update the username, password, and connection settings. If you still get no response, make sure API connections are available for that server.
https://www.ptc.com/en/support/article?n=CS128718
Command cmd = new Command(Command.SI,"projectco");
cmd.addOption(new Option("nolock"));
cmd.addOption(new Option("targetfile","d:/temp/AI_Test.txt"));
cmd.addOption(new Option("project=/ALM_Sample/project.pj/watch/project.pj"));
cmd.addOption(new Option("cpid=:none"));
cmd.addSelection("AiSubsystem.txt");
Hope this helps!
-Andrew