This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "" Watch "" New topic

lusha tak
Ranch Hand

Joined: Dec 30, 2000
Posts: 185
Hello friends..
I am including my test code which establishes a ssl connection to a server and posts an HTTP Post request .which then sends the response back.
This code works fine with jdk1.3.1_01.
But when i try to run the same code sample on j2sdk1.4.2_02, i get Socket Exception. Unexcpected end of file error just after the System.out.println(hello....10)statement. On searching the net i found there is a bug in URLConnection's getContent Method of j2sdk1.4.2_02....which has been fixed in i downladed the same.....and tried to run the same....but now it gives
what could be the reason??
pl. throw some light..

String str = connection.getContentType();
// get the response body reader
java.lang.Object response = connection.getContent(); connReader = new ( response );
// read the response to the output
while ( (c = != -1 )
req.setAttribute("RESP_XML", sb.toString());
catch (Exception e)
req.setAttribute("RESP_XML", e.toString());

if(reader != null)
if(writer != null)
RequestDispatcher dispatcher;
dispatcher = getServletContext().getRequestDispatcher("/abcd.jsp");
dispatcher.forward(req, res);
catch (Exception e1) {
lusha tak
Ranch Hand

Joined: Dec 30, 2000
Posts: 185
Help is greatly appreciated....
thanks a lot..
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Lusha, could you please post the IOException stack trace that is being thrown? That usually helps in defining the problem.
It is sorta covered in the JavaRanch Style Guide.
Similar Threads
Session Cookies
smtp mail server
SSL Connection ....doesnt send response back in jdk1.4!!!
Sending mail with authentication to Exchange Server 2007
URL https connection problems, please help!!!