Java – Server returned HTTP response code: 500 for URL for GET request

hp-quality-centerjavarest

I'm trying to query ALM defects with a filter condition, but I get the below exception. The same URL is working fine when accessed through a browser.

java.io.IOException: Server returned HTTP response code: 500 for URL:
http://ealm11.mycomp.com:80/qcbin/rest/domains/TESTING/projects/2014/defects?query={owner['das'  or 'john' or 'kim'];status[Assigned]}&fields=id    at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at
sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1491)
    at java.security.AccessController.doPrivileged(Native Method)   at
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1485)
    at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)

Also, if the URL does not have the "or" condition in one of the param values as below

http://ealm11.mycomp.com:80/qcbin/rest/domains/TESTING/projects/2014/defects?query={owner['das'];status[Assigned]}&fields=id

it's working but when i introduce "or" conditions, java is throwing the above error.

Best Answer

Have you tried with a "%20" for spaces in the URL?

http://ealm11.mycomp.com:80/qcbin/rest/domains/TESTING/projects/2014/defects?query={owner['das'%20or%20'john'%20or%20'kim'];status[Assigned]}&fields=id
Related Topic