Run OSLC Java Samples on Jazz server using OSLC client
I am trying to run RQMFormSample in org.eclipse.lyo.client.oslc.samples.
I specify these arguments in the Run Configuration
-user itrust
-password itrust1info&
-project "Adaptive Cruise Control Testing"
and I get this error
SEVERE: OSLCC002: An error occurred attempting to login to the Jazz server. Status code 401. Server location: https://jazz.net:443/preview01-qm.
org.eclipse.lyo.client.exception.JazzAuthErrorException: OSLCC002: An error occurred attempting to login to the Jazz server. Status code 401. Server location: https://jazz.net:443/preview01-qm.
at org.eclipse.lyo.client.oslc.jazz.JazzFormAuthClient.login(JazzFormAuthClient.java:200)
at org.eclipse.lyo.client.oslc.samples.RQMFormSample.main(RQMFormSample.java:104)
On debugging I found that JazzFormAuthClient is failing at the form authentication.
HttpPost securityCheck = new HttpPost(this.authUrl + "/j_security_check");
StringEntity entity = new StringEntity("j_username=" + this.user + "&j_password=" + this.password);
securityCheck.setHeader("Accept", "/");
securityCheck.setHeader("X-Requested-With", "XMLHttpRequest");
securityCheck.setEntity(entity);
securityCheck.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
securityCheck.addHeader("OSLC-Core-Version", "2.0");
securityCheck.addHeader("Cookie", jsaCsrfCookie);
resp = httpClient.execute(securityCheck); //fails here
Let me know if we can run the Java sample against the Jazz set up .Does it have the right permissions.
Or what is the way to run these samples