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

22,985

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
Share:
22,985
J28
Author by

J28

Updated on July 26, 2022

Comments

  • J28
    J28 almost 2 years

    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.

  • J28
    J28 over 10 years
    yes it is, otherwise i would've got an error when accessed through browser.
  • J28
    J28 over 10 years
    Tried but no success.
  • Alvin Bunk
    Alvin Bunk over 10 years
    Is it possible to post the full URL. It may be something else in the URL.
  • J28
    J28 over 10 years
    Thanks Alvin, you're right having spaces replaced with %20 and removing " ' " in above url worked.
  • Alvin Bunk
    Alvin Bunk over 10 years
    Ah, I didn't realize that "'" was an invalid URL character as well.