Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

cant read web file from Vista

Thread view: 
patrick - 09 Jan 2008 09:09 GMT
I have a java application which reads a file from a website address:

    URL vers = new URL("mysiteurl"+"/file.txt");
    URLConnection conn = vers.openConnection();
    conn.setDoInput(true);
    conn.setUseCaches(false);
    DataInputStream in = new DataInputStream(conn.getInputStream() );
    String value= in.readUTF();

This works fine  on windows XP,  and fine on Windows Vista if the
application is installed (using Install4j) from a Vista administrator
account.

But if installed from Vista  standard account i always get an exception from
the above:

java.net.ConnectException: Connection refused: connect.

Ive tried this with the different Vista execution levels and get the same
exception.
Reading a html file I get the Exception: Connection refused: connect.

Is there some reason why a java application  cant read a file from the
internet on a Vista standard account?
patrick - 09 Jan 2008 13:21 GMT
Have found that if I turn off Norton personal firewall the error goes away.

But cant switch on the firewall and configure  it to allow my program to
read the file without the Exception.
patrick - 09 Jan 2008 15:43 GMT
Problem solved. Firewall problem.  add the website ip address to Norton
trusted sites.
Roedy Green - 15 Jan 2008 12:50 GMT
>Is there some reason why a java application  cant read a file from the
>internet on a Vista standard account?

use a protocol sniffer.  Sounds like the server may be rejecting you
for some reason.  Compare the headers that get sent under XP vs Vista.

You can also experiment with my code at
http://mindprod.com/products.html#HTTP
to do the same thing.

To talk to a server other that the one from which an applet was loaded
you must be signed.
Signature

Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.