java.io.IOException: Server returned HTTP response code: 500 for URL
843841Dec 6 2006 — edited Dec 6 2006Hi
I have an application running in the server and the application calls that servlet. It runs perfectly fine in my system, but does not in another system. Could any one please let me know why would that strange behaviour happen.
This is how i am connecting to the url
URLConnection urlConnection = url.openConnection();
/**send post data */
((HttpURLConnection)urlConnection).setFollowRedirects(true);
urlConnection.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
urlConnection.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)");
urlConnection.setRequestProperty("Referer",referer);
urlConnection.setRequestProperty("Accept-Language","en-us");
urlConnection.setDoOutput(true);
// write other data
PrintWriter out = new PrintWriter(urlConnection.getOutputStream());
out.print(postdata);
out.close();
/**read response from server*/
urlStream = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
Appreciate all your help
Thanks