Error response in OSLC DM query
Hi,
I'm trying to execute Sample code from lyo.client > DMFormSample.java
I'm sure all of the argument values are correctly set and this class is able to Authenticate on JTS.
But this query response is
"
HTTP 400: Bad Request _in predicate value array is empty Caused by (IllegalArgumentException): _in predicate value array is empty"
Code snapshot :
//STEP 3: Login in to Jazz Server
if (client.login() == HttpStatus.SC_OK) { //STEP 4: Get the URL of the OSLC ChangeManagement catalog String catalogUrl = helper.getCatalogUrl(); //STEP 5: Find the OSLC Service Provider for the project area we want to work with String serviceProviderUrl = client.lookupServiceProviderUrl(catalogUrl, projectArea); //STEP 6: Get the Query Capabilities URL so that we can run some OSLC queries String queryCapability = client.lookupQueryCapability(serviceProviderUrl, OSLCConstants.OSLC_AM_V2, OSLCConstants.AM_RESOURCE_TYPE); //SCENARIO A: Run a query for all AM Resources with OSLC paging of 10 items per //page turned on and list the members of the result OslcQueryParameters queryParams = new OslcQueryParameters(); OslcQuery query = new OslcQuery(client, queryCapability, 10, queryParams); OslcQueryResult result = query.submit(); processPagedQueryResults(result,client, processAsJavaObjects); System.out.println("\n------------------------------\n"); //TODO: Add more DM scenarios }
Any direction troubleshooting this further could be great help.
Thanks in Advance!
Warm Regards,
Jay
|
One answer
Ralph Schoon (63.3k●3●36●46)
| answered Oct 21 '21, 4:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER I think your encoding for the select term is incorrect.
Here a URI with encoding that works for me:
|
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.
Comments
The important information would be the query URI with parameters and encoding. The error is about an _in predicate and I don't see the Query URI created with such a predicate. The QueryParams are empty.
OslcQueryParameters queryParams = new OslcQueryParameters();
queryParams.setSelect(OSLCConstants.DCTERMS_ID + "," + OSLCConstants.DCTERMS_MODIFIED);
OslcQuery query = new OslcQuery(client, queryCapability, 10, queryParams);