Recommended solutions based on your search
Check if you didn't set RequestProperty Content-Type to the wrong type or if you're trying to send the wrong file to the server.
Solutions on the web
java.io.IOException: Server returned HTTP response code: 500 for URL: http://dataserver:8888/mapviewer/omserver
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)