Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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




0 votes


Accepted answer

Permanent link

As far as I can tell, you cannot use this technique against the jazz.net servers - there are many servers in the jazz.net 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

0 votes

Comments

Thanks Donald.I also thought so.


2 other answers

Permanent link

use adapter.properties file

0 votes


Permanent link

 Thanks Subajit for the response.

I think adapter.properties 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.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Dec 19 '17, 5:00 a.m.

Question was seen: 2,577 times

Last updated: Dec 19 '17, 11:46 p.m.

Confirmation Cancel Confirm