UnknownHostException again!
        Posted  
        
            by Nitesh Panchal
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Nitesh Panchal
        
        
        
        Published on 2010-06-16T15:58:32Z
        Indexed on 
            2010/06/16
            16:22 UTC
        
        
        Read the original article
        Hit count: 190
        
java
Hello,
I posted one question previously and all of them answered that there is some problem with DNS but i changed my DNS to many addressed and now i have the most reliable, google DNS :-
8.8.8.8
Still i get the same UnknownHostException. What can be the problem? This is my code :-
 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                DocumentBuilder db = dbf.newDocumentBuilder();
                Document doc = db.parse("http://rss.news.yahoo.com/rss/india");
Infact if i pass address as something very common like :- http://google.com i still get the same error. Please help me :(. I have my submissions tomorrow.
Thanks in advance :)
EDIT : If i type the same address in my mozilla, it works great. So, i am sure that there is no DNS problem.
2nd EDIT :- I found this link http://www.ehow.com/how_4747553_fix-unknownhostexception-java-applications-ubuntu.html
But when i run the command
sudo apt-get install lib32nss-mdns
i get package not found.
Somebody even mentioned :-
-Djava.net.preferIPv4Stack=true
But where do i write this statement of Djava?
I am using Netbeans 6.8 to run my web application
© Stack Overflow or respective owner