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: 422 for URL:
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)