aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Request web Page on Glassfish server using java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Request web Page on Glassfish server using java code" Watch "Request web Page on Glassfish server using java code" New topic
Author

Request web Page on Glassfish server using java code

Mohamed Nahas
Greenhorn

Joined: Dec 29, 2011
Posts: 1
Dears,

am trying to read web page from java code and its fine for general web site like google.com but when using the same code to read page on glassfish server at my computer i have this error:-

java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:652)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
at java.net.URL.openStream(URL.java:1010)

and this is my code:-

String urlString =
"http://localhost:8080/Mirnint_Library-Mirnint_Message-context-root/Sending.jsp"
try {
URL url;
url = new URL(urlString);
Scanner in = new Scanner(url.openStream());
while (in.hasNext())
System.out.println(in.nextLine());
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request web Page on Glassfish server using java code
 
Similar Threads
java.net.SocketException (while getting data from an url)
HttpURLConnection problem
Rampart Axis2 passwordCallback method - Urgent Please
Why settimeout is not working?