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

Is there a solution to oslc.prefix with multiple entries causes a HTTP/1.1 500 Internal Server Error on a RM5.0 server?

I found an issue what I think to be an issue with multiple items in a oslc.prefix. The issue was found an a larger code base, but to demonstrate the issue on a smaller testcase, I used some example code from the IBM Rational CLM 2012 OSLC Workshop:

I modified Example05 to add an additional term in the oslc.prefix (types). The code passes on a RM4.0 server, but fails on a RM5.0 server.

String oslcSearchByIdentifierQuery = 
    queryCapabilityURI + 
"&oslc.prefix=" +
URLEncoder.encode("dcterms=<http://purl.org/dc/terms/>", "UTF8") + "," +
URLEncoder.encode("types=<http://www.ibm.com/xmlns/rdm/types/>", "UTF8") +
"&oslc.select=" +
URLEncoder.encode("dcterms:title", "UTF8") +
"&oslc.where=" + URLEncoder.encode("dcterms:identifier=" + identifier, "UTF8");

Error message:

java.lang.Exception: Error occured while posting

HTTP/1.1 500 Internal Server Error

      at net.jazz.oslc.utils.HttpUtils.sendPostForSecureDocument(HttpUtils.java:311)

      at net.jazz.oslc.consumer.examples.e05.performQuery(e05.java:110)

      at net.jazz.oslc.consumer.examples.e05.run(e05.java:56)

      at net.jazz.oslc.consumer.examples.e05.main(e05.java:176)


I am using httpclient-4.0.1.jar. Do I need a newer version of the client or is there an update to the workshop code to make it compatible with RM5.0?



0 votes

Comments

Here is the code fragment:

String oslcSearchByIdentifierQuery =
    queryCapabilityURI +
    "&oslc.prefix=" +
    URLEncoder.encode("dcterms=<http://purl.org/dc/terms/>", "UTF8") + "," +
    URLEncoder.encode("types=<http://www.ibm.com/xmlns/rdm/types/>", "UTF8") +
    "&oslc.select=" +
    URLEncoder.encode("dcterms:title", "UTF8") +
    "&oslc.where=" + URLEncoder.encode("dcterms:identifier=" + identifier, "UTF8");


Accepted answer

Permanent link
Hi,
 Could you try following options ?
1) Add multiple oslc.properties entries, one for each value
2) URL encode the "," char that separates the entries.

Best Regards.
Jeff Freeman selected this answer as the correct answer

0 votes

Comments

One thing I did not mention is that I post the exact same URL to both servers with the REST API client and I did not receive any HTTP error from the REST client. This seems to me that the apache http client version may need to be updated?

I am not familiar with #1. I will try #2.

I tried #2 and there was no difference.

I found the answer in the forum:

https://jazz.net/forum/questions/143241/rrc-v405-and-oslc-query

Pls try using an oslc.prefix entry for each namespace definition like :
&olsc.prefix=<dcterms....>&oslc.prefix=<other prefix.....="">

Gabriel, you are correct with #1.


From https://jazz.net/forum/questions/143241/rrc-v405-and-oslc-query
Pls try using an oslc.prefix entry for each namespace definition like :
&olsc.prefix=<dcterms....>&oslc.prefix=<other prefix.....="">


One other answer

Permanent link
I specified the following for my query. It ignores the dcterms and returns over 6000 rows. I am using DNG 6.03 and running HTTP-GET on POSTMAN


oslc.query=true&
oslc.prefix=dcterms=<http://purl.org/dc/terms/>&
oslc.prefix=oslc_rm=<http://open-services.net/ns/rm#>&
oslc.select=oslc_rm:uses&
oslc.where=dcterms:identifier=81972

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

Question asked: Nov 19 '15, 3:35 a.m.

Question was seen: 3,209 times

Last updated: Dec 02 '18, 7:38 p.m.

Confirmation Cancel Confirm