Java API not working after upgrading to Integrity 10.9
Hi all,
we have just upgraded integrity to 10.9 from 10.6 and surprisingly java API is not working.
I am using same mksapi.jar to connect to integrity which I used it on 10.6, is this problem?
or I am using wrong minor and major version number for upgraded system@? below is sample code which fails and gives error :
Error :com.mks.api.response.APIConnectionException: Failed to establish a session: Session not authenticated/authorized.
My credentials are correct and using which I can log in through integrity Client GUI.
Code :
public void test_9009()
{
Session session = null;
try
{
String itemID = "1234";
IntegrationPoint ip = IntegrationPointFactory.getInstance().createIntegrationPoint("integritytst.myorg.com", 9009, true, 4, 12);
session = ip.createSession("USERNAME_HERE", "PASSWORD_HERE");
CmdRunner cmdRunner = session.createCmdRunner();
Command cmd = new Command(Command.IM, "viewissue");
cmd.addSelection(itemID);
//printCommand(cmd);
Response response = cmdRunner.execute(cmd);
WorkItemIterator wit = response.getWorkItems();
while (wit.hasNext())
{
System.out.println("****************************WorkItem********************************");
WorkItem wi = wit.next();
Iterator fit = wi.getFields();
while (fit.hasNext())
{
Field field = (Field) fit.next();
System.out.println("\t" + field.getName() + " ---------> " + field.getValueAsString() + " DataType: " + field.getDataType());
}
}
session.release();
} catch (APIException | IOException e)
{
e.printStackTrace();
System.err.println("Error :" + e.getMessage());
}
finally
{
try
{
if (session != null)
{
System.err.println("Closing session............................");
session.release();
}
} catch (IOException | APIException e)
{
System.err.println("unable to close session");
}
}
}

