It's all about the answers!

Ask a question

Run OSLC Java Samples on Jazz server using OSLC client

Anusuya Manohar (135) | asked Dec 19 '17, 5:00 a.m.

 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:
org.eclipse.lyo.client.exception.JazzAuthErrorException: OSLCC002: An error occurred attempting to login to the Jazz server.  Status code 401.  Server location:
at org.eclipse.lyo.client.oslc.jazz.JazzFormAuthClient.login(
at org.eclipse.lyo.client.oslc.samples.RQMFormSample.main(

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.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

Accepted answer

permanent link
Donald Nong (14.5k614) | answered Dec 19 '17, 11:41 p.m.

As far as I can tell, you cannot use this technique against the servers - there are many servers in the domain and some URIs are not properly exposed by the reverse proxy.

Set up your own server for testing your code.

Anusuya Manohar selected this answer as the correct answer

Anusuya Manohar commented Dec 19 '17, 11:46 p.m.

Thanks Donald.I also thought so.

2 other answers

permanent link
Subhajit Bhuiya (6222) | answered Dec 19 '17, 9:01 a.m.

use file

permanent link
Anusuya Manohar (135) | answered Dec 19 '17, 9:12 a.m.

 Thanks Subajit for the response.

I think is used to configure the classes  in org.eclipse.lyo.client.oslc.samples.automation package
Anyways, I tried to change the parameter values in the properties file but I get the same error.

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.