Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.io.IOException: Server returned HTTP response code: 500 for URL

843841Dec 6 2006 — edited Dec 6 2006
Hi

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2007
Added on Dec 6 2006
2 comments
580 views