473,320 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

URL class handling problem .....

dmjpro
2,476 2GB
Hi friends .. today i started to learn URL class handling.
actually today morning JOASH replied to an answer that using URL an input stream can be opened.
a diiferent server side file can be accessed from another server.

so i started ... a fantastic idea .... frnds.

but i have a problem with my code ....

import java.net.*;
import java.io.*;

class URLTest
{
public static void main(String args[]) throws Exception
{
URL l_url = new URL("http://www.thescripts.com/forum/forum130.html");
BufferedInputStream l_file = new BufferedInputStream(l_url.openStream());
int ch;
while((ch = l_file.read()) != -1) System.out.println(ch);

System.out.println("\n\n\nYahoo ......");
}
}
now read carefully my problems what i faced .....

here an exception thrown is ..... UNKNOWN HOST EXCEPTION ... thescripts.
why???

if i modify the URL as
https://172.20.0.200/CoalNetPROD/common/jsp/login.jsp

actually it is our server where i m working .....here HTTPS used
here it tells that ... unknown URL specification HTTPS.
why???

plz tell me the URL class story ... when openStream method is called...
plz help guys....

kind regards.
dmjpro.
May 22 '07 #1
2 1719
JosAH
11,448 Expert 8TB
The code snippet you supplied works fine for me; I'm afraid you're dealing with
firewalls or dns problems.

kind regards,

Jos
May 22 '07 #2
dmjpro
2,476 2GB
how can i solve these problems???

plz help.

kind regards.
dmjpro.
May 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: J. A. Bailo | last post by:
I wrote an Outlook InterOp program. One of the declarations assigning a MAPI folder to a variable, throws an error if an instance of Operator is left open. That is not the problem. The...
1
by: Sean W. Quinn | last post by:
Hey folks, I have a question regarding file handling, and the preservation of class structure. I have a class (and I will post snippets of code later in the post) with both primitive data...
42
by: WindAndWaves | last post by:
Dear All Can you tell me why you use a class module??? Thank you Nicolaas ---
18
by: Elder Hyde | last post by:
Hey all, A class of mine needs to tell the outside world when its buffer is not empty. The problem is that C# seems to force you to put the event-raising code in the base class. To illustrate,...
5
by: charliewest | last post by:
I've implemented the USING statement to ensure that my newly created sql connection closes when my method is finished using it. The USING statement is wrapped in try/catch error handling statement....
17
by: ahaupt | last post by:
Hi all, I'm currently writing a load of class libraries, but not the main application iteslf. I want to provide some method for reporting errors back to the main application. At the moment...
0
by: RJN | last post by:
Hi Sorry for the repeated posting. This is about using ServiceConfig class for utilizing COM+ servcies. In my application architecture, the business logic classes talk to the data access...
3
by: johncee | last post by:
Greetings, I created a base class that has a datagrid. I've made it generic as possible so that any derived classes pass some info to the base constructor (including a SQL select stmt) &...
4
by: Pupeno | last post by:
Hello, I want to jump over a method in the class hierarchy, that is: If I have class A(object), clas B(A), class C(B) and in C, I want a method to do exactly what A does but not what B does in...
55
by: tonytech08 | last post by:
How valuable is it that class objects behave like built-in types? I appears that the whole "constructor doesn't return a value because they are called by the compiler" thing is to enable...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.