It's all about the answers!

Ask a question

Error response in OSLC DM query


Jayesh Gaikar (59215) | asked Oct 14 '21, 1:47 p.m.
edited Oct 14 '21, 1:48 p.m.
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

Comments
Ralph Schoon commented Oct 15 '21, 2:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Jayesh Gaikar commented Oct 15 '21, 9:50 a.m.
Hi Ralph,
Thanks for your response!
I have included query parameter as follows and still result is same.

Code snap where query parameter included

                OslcQueryParameters queryParams = new OslcQueryParameters();

                queryParams.setSelect(OSLCConstants.DCTERMS_ID + "," + OSLCConstants.DCTERMS_MODIFIED);
                OslcQuery query = new OslcQuery(client, queryCapability, 10, queryParams);



Ralph Schoon commented Oct 20 '21, 7:37 a.m. | edited Oct 20 '21, 7:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Sorry, no idea I can't seem to understand where the _in comes from.
I suspect that you are the API incorrectly. The API, even if it contains OSLC is not an OSLC query it is similar to /oslc/queries.xml? in RTC in https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2#Using_Stored_Queries

This is not OSLC, despite it mentions that and I am not sure if you use the wrong framework.


Sorry. I can't help.

One answer



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.