It's all about the answers!

Ask a question

RTC workitems quering problem


michal rapacki (261) | asked Nov 20 '09, 10:10 a.m.
Hi ,

I am testing the curl API for data fetching and updating at RTC server.

I have been successfully authorized to my server, and data for one specific workitem can be fetched without any problem.


I have faced one error, when I wanted to fetch the query for workitems.
Here is an output:

CURL querry:
https://localhost/jazz/oslc/queries.xml?oslc_cm.query=dc:type="defect"

Call stack for error in tomcat:
2009-11-19 15:13:31,359 ERROR com.ibm.team.workitem.service - Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
at java.sql.Timestamp.valueOf(Timestamp.java:316)
at com.ibm.team.repository.common.query.DataRow.getObject(DataRow.java:143)
at com.ibm.team.workitem.common.internal.util.DataQueryIterator.toList(DataQueryIterator.java:90)
at com.ibm.team.workitem.common.internal.util.DataQueryIterator.update(DataQueryIterator.java:76)
at com.ibm.team.workitem.common.internal.util.DataQueryIterator.hasNext(DataQueryIterator.java:55)
at com.ibm.team.workitem.common.internal.util.QueryIterator.toList(QueryIterator.java:26)
at com.ibm.team.workitem.service.internal.oslc.resources.ItemCollectionResource.getETag(ItemCollectionResource.java:195)
at com.ibm.team.workitem.service.internal.oslc.RequestHandler.handleGET(RequestHandler.java:119)
at com.ibm.team.workitem.service.internal.oslc.RequestHandler.handleGET(RequestHandler.java:106)
at com.ibm.team.workitem.service.internal.oslc.OSLCService.perform_GET(OSLCService.java:36)
at com.ibm.team.repository.service.TeamRawService.service(TeamRawService.java:82)
at sun.reflect.GeneratedMethodAccessor320.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

HTTP response:
<xml><oslc_cm><oslc_cm>500</oslc_cm><oslc_cm>Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff</oslc_cm></oslc_cm>


Could You advice me in this matter ?


Thanks,
Michal

4 answers



permanent link
Patrick Streule (4.9k21) | answered Nov 20 '09, 11:08 a.m.
JAZZ DEVELOPER
I have faced one error, when I wanted to fetch the query for
workitems.
Here is an output:

CURL querry:
https://localhost/jazz/oslc/queries.xml?oslc_cm.query=dc:type="defect"

With this URL, you are querying queries, not work items, and queries don't
have a dc:type field. Nevertheless, this is a bug as the correct behavior
would be to report that dc:type is illegal for queries.

https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/99995


To query for work items, you have to use the query URL from the discovery
document, e.g.:


https://localhost:9443/jazz/oslc/contexts/_nIILMNXHEd6hqqpQoGYDrA/workitems?oslc_cm.query=dc%3Atype%3D%22defect%22

--
Regards,
Patrick
Jazz Work Item Team

permanent link
michal rapacki (261) | answered Nov 23 '09, 9:46 a.m.
Thanks for answer.

Let's correct the query.

curl -k -c $COOKIES "$HOST/authenticated/identity" > /dev/null
curl -k -L -b $COOKIES -c $COOKIES -d j_username=$USER -d j_password=$PASSWORD "$HOST/authenticated/j_security_check" > /dev/null
curl -k -b $COOKIES -H "Accept: application/json" "$HOST/oslc/contexts/_xOCa0LJSEd6FWYCjUcr1AQ/workitems"

"message": "Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff",
"status": 500

And problem still exists. Is this a bug , as it was mentioned before?
Or am I doing anything wrong ?

Thanks.
Michal

permanent link
Patrick Streule (4.9k21) | answered Nov 23 '09, 11:38 a.m.
JAZZ DEVELOPER
Thanks for answer.

Let's correct the query.

curl -k -c $COOKIES "$HOST/authenticated/identity"
/dev/null
curl -k -L -b $COOKIES -c $COOKIES -d j_username=$USER -d
j_password=$PASSWORD "$HOST/authenticated/j_security_check"
/dev/null
curl -k -b $COOKIES -H "Accept: application/json"
"$HOST/oslc/contexts/_xOCa0LJSEd6FWYCjUcr1AQ/workitems"

"message": "Timestamp format must be yyyy-mm-dd
hh:mm:ss.fffffffff",
"status": 500

And problem still exists. Is this a bug , as it was mentioned before?
Or am I doing anything wrong ?

I just looked into this more closely today and it is actually a
regression, which will be fixed in 2.0.0.2.

Please see
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/99995
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/100081

--
Regards,
Patrick
Jazz Work Item Team

permanent link
michal rapacki (261) | answered Nov 24 '09, 4:57 a.m.
Thanks for help in identifying the problem.
I am looking forward to see the 2.0.0.2 ver publishied :) .

Rgrds,
Michal

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.