Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hello,
I am using MKS Java API to creat Sandbox/drop Sandbox for a project. The code works fine in my local (win7+Integrity10 client+hotFix s100000000-022). However, when I tested in an AIX server (the server has Intergrity10 client +HotFix s100000000-022), the same code always throw exception. I tested si command from aix command line and it worked fine. All enviornment varibles are set as builder guide/user guide suggested.
By the way, I tested si command from AIX command line and the si command worked without any issue.
The following is the exception:
java.lang.UnsatisfiedLinkError: Cannot load apiclientrunner
at com.mks.connect.ClientCmdRunnerImpl.(ClientCmdRunnerImpl.java:53)
at com.mks.connect.UserApplicationSessionImpl._createCmdRunner(UserApplicationSessionImpl.java:546)
at com.mks.connect.CmdRunnerCreatorImpl.createCmdRunner(CmdRunnerCreatorImpl.java:90)
=================================================================================
The following is my code:
cmdRunner = ipf.createLocalIntegrationPoint(4,11).getCommonSession().createCmdRunner();
// Set only to override client defaults
cmdRunner.setDefaultHostname(mks_host);
cmdRunner.setDefaultPort(mks_port);
cmdRunner.setDefaultUsername(username);
cmdRunner.setDefaultPassword(password);
Command cmd = new Command(Command.SI, "createsandbox");
cmd.addOption(new Option("R"));
cmd.addOption(new Option("recurse"));
cmd.addOption(new Option("project",project));
cmd.addOption(new Option("scope","anyrevlabellike:"+lable));
cmd.addOption(new Option("Y"));
cmd.addOption(new Option("devpath",devpath));
cmd.addOption(new Option("cwd",cwd));
cmdRunner.execute(cmd);
Thanks in advance if anyone can help out here!
I think that it has something to do with using local integration on a non-Windows system. Have you tried using a direct connection to the server instead?
Change:
cmdRunner = ipf.createLocalIntegrationPoint(4,11).getCommonSession().createCmdRunner
To:
cmdRunner = ipf.createIntegrationPoint(mks_host,mks_port,4,11).createSession(mks_username,mks_password).createCmdRunner
I know this is might not be a suitable solution, but it might help you out in cases where your code is sitting on a server.
Thanks Rich for the suggestion. Yes, if usr server intergrition point, the code work. It at least approve that the issue is related to the Integrity client component.
However, our project do need to be able to download the files to the local unix server. So, I have to use localIntegritonPoint.
Do you or anyone else know if this is a known defect in MKS Client unix version?
Regards,
Maybe you could have a look at the JENKINS Plugin sources
https://github.com/jenkinsci/integrity-plugin/tree/master/src/main/java/hudson/scm
It shows so goog example on your use case:
+ use server integration point
+ checkout file to local machine
HTH