URL.openstream doesn't work

Hi,
I run the demo program form java tutorial. Code as below:
import java.net.*;
import java.io.*;
public class urltest {
public static void main(String[] args) throws Exception {
     URL yahoo = new URL("http://www.yahoo.com/");
     BufferedReader in = new BufferedReader(
                    new InputStreamReader(
                    yahoo.openStream()));
     String inputLine;
     while ((inputLine = in.readLine()) != null)
     System.out.println(inputLine);
     in.close();
but it gives the follow output
Exception in thread "main" java.net.NoRouteToHostException: Operation timed out:
no further information
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at java.net.URL.openStream(Unknown Source)
at urltest.main(urltest.java:30)
Plz advise.

Thx Jean, I modify the OS to Windows 95, but the program still don't work
code:
import java.net.*;
import java.io.*;
public class urltest {
public static void main(String[] args) throws Exception {
     URL yahoo = new URL("http://www.yahoo.com/");
     HttpURLConnection uc = (HttpURLConnection)yahoo.openConnection();
uc.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows 95)");
uc.setRequestProperty("Connection","Keep-Alive");
uc.setDoOutput(true);
uc.setDoInput(true);
uc.setUseCaches(false);
uc.setRequestMethod("GET");
uc.setFollowRedirects(false);
uc.setInstanceFollowRedirects(false);
     BufferedReader in = new BufferedReader(
                    new InputStreamReader(
                    uc.getInputStream()));
     String inputLine=in.readLine();
     //while ((inputLine = in.readLine()) != null)
     System.out.println(inputLine);
     in.close();
The output is
Exception in thread "main" java.net.NoRouteToHostException: Operation timed out:
no further information
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at urltest.main(urltest.java:39)
Plz advise

Similar Messages

  • URL blocking doesn't work on E4200

    I have the 1.0.03 firmware installed and URL blocking doesn't work.  I assigned the policy to the entire address range and could still access the web site I wanted to block.

    What website? https or http?
    You can't block https...

  • Safari copy url button doesn't work

    I just upgraded from an ipad2 to an iPad air 2. Before, if I wanted to copy and paste a url I'd use the copy button. Now,on the new iPad air 2, the copy button just wipes out whatever I've previously copied, and doesn't copy the url.

    You tap and hold down in the URL field until you get the option to select all. Then you choose the option to select all. An option to Copy appears and you select that and then you should be able to paste that URL into a text field.
    Safari copy url button doesn't work
    I Realize that you must know the steps but I am just double checking. If that is not working for you, and you are not having copy and paste issues elsewhere in other apps, I would try clearing Safari, force close it and then reset your iPad.
    Go to Settings>Safari>Clear History and Website Data
    Now force close Safari. In order to close apps, you have to drag the app up from the multitasking display. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app preview thumbnail to close it.
    Next, reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Filter Web Template with URL Cmd: doesn't work with compound infoobject ?

    Hello all,
    I've to filter the query contained on a web template with URL command, but it doesn't work.
    The web template contains only one query, and on the free chars I have 0PLANT.
    I call the web template adding to the normal url the following command:
    &FILTER_IOBJNM=0PLANT&FILTER_VALUE=33
    where 33 is the code of the plant I want to filter.
    The command is executed, I think, because the  result is "NO APPLICABLE DATA FOUND". The fact is that when I execute this query on the Bex filtering 0PLANT by value 33 the data exists.
    May be because 0PLANT on our system is in compound with 0SOURSYSTEM ? In this case, what's the value I can use as filter ?
    Thank's in advance,
    Max

    Hi,
    please see http://help.sap.com/saphelp_nw04/helpdata/en/59/edfe395dd76846e10000000a114084/frameset.htm
    especially:
    If the variant with ending 'EXT' is selected, the fully compounded value has to be entered in the external format, for example, 24.12.2000.
    If the ending 'EXT' is not used, the fully compounded value has to be entered in the internal format, for example, 20001224 for 24.12.2000.
    and
    In the internal display (see table below) you can easily determine the name of the characteristic and the filter value using the URL parameter &snippet_operations=%20 (see also Object Tag for the Properties of Web Templates). Call the Web application with this URL parameter. If you filter using the context menu, the parameters FILTER_IOBJNM and FILTER_VALUE are automatically added to the URL in the Web browser. You can then use the desired values with Command URLs in hyperlinks.
    Heike

  • ExecuteWithParams with URL parameter doesn't work

    Hi!
    There are a lot of posts about executing VO with parameters, but I'm still stuck on it. I have a VO with WHERE condition like this:
    WHERE TABLE.ID = :IdParm
    I want this binded variable to get populated in jspx page by parameter in URL. I've created a binding for ExecuteWithParams in my pageDef like this:
    <action IterBinding="MyViewGIterator" id="ExecuteWithParams"
    InstanceName="AppModuleDataControl.MyViewG"
    DataControl="AppModuleDataControl" RequiresUpdateModel="true"
    Action="95">
    <NamedData NDName="IdParm" NDValue="${param.IdParm}"
    NDType="java.lang.String"/>
    </action>
    and an executable on this:
    <invokeAction Binds="ExecuteWithParams" id="callExecuteWithParams"
    Refresh="ifNeeded"/>
    so the executables in my pageDef look like this:
    <executables>
    <iterator id="MyViewGIterator" RangeSize="10"
    Binds="MyViewG" DataControl="AppModuleDataControl"/>
    <variableIterator id="variables">
    <variable Name="parameterURL" Type="String"
    DefaultValue="${param.IdParm}"/>
    </variableIterator>
    <invokeAction Binds="ExecuteWithParams" id="callExecuteWithParams"
    Refresh="ifNeeded"/>
    </executables>
    I have a variableIterator that is binded on outputText control on my jspx just to test if parameter gets read correctly and it does.
    What am I doing wrong that query doesn't execute correctly and I don't have any data on my page? I've also tried with refresh condition "Always" but it doesn't help.
    Any help would be much appreciated.
    BB
    Message was edited by:
    Brokenbone

    Hi,
    do the following:
    - In the pageDef file (Executable section), create a "Parameter". The name of this parameter is up to you.
    - the value of this parameter point to #{param.IdParm}
    - In the ExecuteWithParam OperationBinding, select the agument item and select the NDVaue. Open the ExpressionLanguage editor and select the Parameter you just created
    Here's a working pageDef file example:
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
                    version="10.1.3.41.57" id="RequestParamTestPageDef"
                    Package="adf.testcases.view.pageDefs">
      <parameters>
        <parameter id="param1" value="#{param.param1}"/>
      </parameters>
      <executables>
        <iterator id="DepartmentsVOWithBindVar1Iterator" RangeSize="10"
                  Binds="DepartmentsVOWithBindVar1"
                  DataControl="AppModuleDataControl"/>
        <invokeAction id="executeDepartments" Binds="ExecuteWithParams"/>
      </executables>
      <bindings>
        <table id="DepartmentsVOWithBindVar1"
               IterBinding="DepartmentsVOWithBindVar1Iterator">
          <AttrNames>
            <Item Value="DepartmentId"/>
            <Item Value="DepartmentName"/>
            <Item Value="ManagerId"/>
            <Item Value="LocationId"/>
          </AttrNames>
        </table>
        <action IterBinding="DepartmentsVOWithBindVar1Iterator"
                id="ExecuteWithParams"
                InstanceName="AppModuleDataControl.DepartmentsVOWithBindVar1"
                DataControl="AppModuleDataControl" RequiresUpdateModel="true"
                Action="95">
          <NamedData NDName="deptId" NDValue="${bindings.param1}"
                     NDType="oracle.jbo.domain.Number"/>
        </action>
      </bindings>
    </pageDefinition>Frank

  • Url variable doesn't work in IE

       Hey guys, my page, www.powerhouse.com/Products/Inventory.php I have a bunch of links that reload the page with a url variable.  If FF 3, this works fine, yet in IE 8 the page does not load.  My error log has the following error:
    script '/var/www/powerhouse/public_html/Products/inventory.php' not found or unable to stat
    what stupid IE Hack do I need to get this to work?

    PHE Admin wrote:
    My error log has the following error:  
    script '/var/www/powerhouse/public_html/Products/inventory.php' not found or unable to stat
    what stupid IE Hack do I need to get this to work?
    You don't need any IE hack. I have just tested the page in both FF and IE8. It works just fine in both.
    However, it's very noticeable from your error log that it refers to inventory.php (all lowercase), whereas the actual page is Inventory.php (initial cap). The other thing that's noticeable is the path, which indicates your server is running on Linux, which is case-sensitive.
    From this, I conclude that you originally coded the page using inventory.php, and later updated it. This suggests that IE8 is probably still using a cached version. Clear your cache, and the problem will probably go away.

  • URL button doesn't work after export into ppt/word/pdf

    Hi,
    I am working in Xcelsius.
    Lets say I have placed a URL button in the Canvas and mapped that to a path of the file(which is not actualy an URL),but any path of the file which is present in the local system
    After exporting this dashboard into ppt(or word/pdf),when i click the button,its not redirecting me to a target.
    But during Preview of dashboard,it works fine.But after exporting,the URL button not redirects me to the path specified.
    Rgds,
    Murali

    Hi
    U got any solution for the above problem?
    Thanks
    Kothai

  • URL Cloaking doesn't work with Safari - IE & Firefox work fine

    Hi There,
    just wondering if anyone else has had this problem.
    If I choose "URL Cloaking" from the domain options on my ISP's site, Safari cannot find my site, or links on the site quite often will not work.
    IE on a PC and Firefox on both platforms work fine.
    Does anyone have any suggestions? My Site URL is: www.svelte.net.nz
    Any help would be much appreciated as cloaking hides the .Mac address which is kind of useful.
    Cheers
    Ben

    HI There Tom,
    I turned URL cloaking off so hadn't come back to the forum to see your reply - sorry for this. But now I need to have cloaking back on.
    I'm not an HTML coder so don't know what I'm looking for. I might send this in to Apple and see If I get a response. Anyway, here is the code in case you or someone else knows if the ISP has got something wrong.
    Any help would be much appreciated.
    Cheers
    Ben
    <!-- 13452:33834:www.svelte.net.nz:<a class="jive-link-external-small" href="http://web.mac.com/ben.sciascia/:cloak:">http://web.mac.com/ben.sciascia/ :cloak:</a> --><html>
    <frameset rows="*" cols="*" >
    <frame name="topFrame" scrolling="auto" src="http://web.mac.com/ben.sciascia/" frameborder="NO" marginwidth="0" noresize marginheight="0">
    </frameset>
    </html>

  • URL request doesn't work outside of Flash Pro [CS6]

    I've been working on a XML project in class using Hellcat, and everything seemed to be working properly, untill I used the html test in google chrome. None of the links would work, nor would it show an error. I thought "hey this is beta software, so it might be an error." and re-did the project in CS6. The exact same issue occured. I decided to test it in another browser. I opened it in Nightly (Firefox) and instead it blocked access to the link. I can't change the setting to allow it either (didn't show in the settings); so I don't know if it works there.
    Here's my AS3 code:
    var navURL2 = "http://" + (myXML.LINK[1]);
    nav2.addEventListener(MouseEvent.CLICK, onClick2);
    bg2.addEventListener(MouseEvent.CLICK, onClick2);
    function onClick2(e:MouseEvent):void{
    navigateToURL(new URLRequest(navURL2), "_blank");
    and the XML: (I cut out the parts that aren't needed)
    <LINK TITLE="">www.google.com</LINK>
    What it's supposed to do:
    It allows low-end users create a simple nav bar by editing elements in XML, and changing a link. You can change everything from the link, to the background of the swf.

    I actually found the issue. Something was going on with my computer and wasn't allowing the links to be used on local host. But when I tested it on one of my websites, it ran find, then I had to add some exceptions and it started working corretly, thanks for the answer though.

  • Web.SHOW_DOCUMENT('URL', '_blank') doesn't work for Internet Explorer 7

    Hello,
    In my company, we are using Oracle Forms 10.1.2.0.2.
    After inserting a URL, users are logged in. There is one page in the application that uses a button to open a PDF in a new page.
    Code behind this button:
    web.SHOW_DOCUMENT('URL', '_blank');
    For internet explorer 6, there is no problem, but last week, some users have upgraded their browser to Internet Explorer 7. When they now push the PDF button, nothing happens. No error is given.
    Could someone please help me..

    Actually, I think a couple of my colleagues have seen this with IE7 recently... It seemed to be related to individual PCs rather than anything in our software, and was sort-of sporadic. I think on one of the PCs, there'd been an update to the Google toolbar and that had caused problems (and of course, if you have Google toolbar, that has its own popup blocker that you need to disable for the site in question.)
    Sorry to be vague, but I would look for any other browser plug-ins on the machine that might be causing issues.
    James

  • Adobe Connect Add- in link doesn't work

    I've gone to the download page for the Connect add-in, and when I click on the link to download the software, the browser is brought to a corrupted webpage of data. The add-in does not download.
    This is the URL I'm going to -
    http://helpx.adobe.com/adobe-connect/kb/connect-902-add-in.html
    On this page, there is a link to download the Connect Add-in for Mac. When using either Firefox or Safari, when the Mac download link is clicked, nothing is downloaded, and the browser displays a corrupt webpage.
    Is there an alternate link to download the Add-in for Mac?
    Thanks

    Hi,
    I was able to download addin build # 959 from the download link provided on the page: http://www.adobe.com/support/connect/downloads-updates.html. using Safari on Mac.
    Anyways this is the GoUrl to download the Mac addin, if the above URL still doesn't work for you: http://www.adobe.com/go/adobeconnect_9_addin_mac
    Thanks
    Sameer Puri

  • Accessing Collaboration Room with Room Link (URL) doesn't work

    hi all
    i'm trying to access a collaboration room by room link (url) but it doesn't work. the room url is: https://www.sportal.ch:443/irj/index.html?NavigationTarget=CollaborationConnector://portal_content/com.sap.ip.collaboration/Rooms/b0ce78ec-3f30-2910-2184-b171271d4d95/workset&NavTargetAsRoot=true
    i have checked the roombackend-properties => they are ok
    i have checked the roles and permissions => they are ok
    what me surprises: when i open a new browser window and type in the mentioned url, our portal-start-page is displayed but in the content area there is no content displaied. i expected, that when i type in the url, then the authentification-dialogue would appear, but it does not.... (does this url only work if i am already logged in the portal??)
    if you have any ideas, how the problem could be solved, please let me know!
    thank you for your help.
    greetings
    flo

    hi ingo
    thank you for the input. i have now solved the problem, perhaps my solution fits for you too. here it is:
    when i use the function "send room-link" the url looks like this:
    https://www.sportal.ch:443/irj/index.html?NavigationTarget=CollaborationConnector://portal_content/com.sap.ip.collaboration/Rooms/9020275c-8348-2810-28a6-a8c1ae60e192/workset&NavTargetAsRoot=true
    with this url i can not access the collaboration room.
    but when i change the url like this:
    https://www.sportal.ch/irj/portal?NavigationTarget=ROLES://portal_content/com.sap.ip.collaboration/Rooms/9020275c-8348-2810-28a6-a8c1ae60e192/workset&NavTargetAsRoot=true
    now i can access the room (with authentification).
    OK, for me the main problem is solved, but can someone perhaps tell me whats the difference between:
    NavigationTarget=CollaborationConnector
    and
    NavigationTarget=ROLES
    thank you for your help!
    greetings
    flo

  • URL.openStream() works in Windows but not in Linux

    I am having a problem with this line:
    BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
    in the code sample further below.
    A simple program using this line works when compiled in my Windows XP:
    java version "1.6.0_03"
    Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
    Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)
    but not when compiled on my RedHat FC 4 server:
    java version "1.4.2"
    gij (GNU libgcj) version 4.0.2 20051125 (Red Hat 4.0.2-8)
    The program (making using of a previous froum example and pared down to minimize tangent topics):
    The code works for all 3 URLs in Windows. In Linux it only works for the 1st one (bbc.co site)
    Error is listed below the code:
    import java.net.*;
    import java.io.*;
    public class BBC {
    public static void main(String[] args) throws Exception
    //    URL url = new URL("http://news.bbc.co.uk/sport1/hi/football/eng_prem/6205747.stm");
    //    URL url = new URL("http://www.weatherunderground.com/global/stations/71265.html");
        URL url = new URL("http://www.weatherunderground.com");
        BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
        int nLineCnt = 0;
        String inputLine;
        while ((inputLine = in.readLine()) != null)
            nLineCnt++;
        System.out.println("nLineCnt=" + nLineCnt);
    //--------------------------------------------------------------------------------------------------------------------------------------------Exception in thread "main" java.lang.StringIndexOutOfBoundsException
    at java.lang.String.substring(int, int) (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.net.protocol.http.Request.readResponse(gnu.java.net.LineInputStream) (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.net.protocol.http.Request.dispatch() (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.net.protocol.http.HTTPURLConnection.connect() (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.net.protocol.http.HTTPURLConnection.getInputStream() (/usr/lib/libgcj.so.6.0.0)
    at java.net.URL.openStream() (/usr/lib/libgcj.so.6.0.0)
    at BBC.main(java.lang.String[]) (Unknown Source)
    at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
    Can anyone please suggest what I can do to be able to process the weatherunderground URL?
    Claude

    To me it would suggest a bug in the VM that you are using.
    Solutions
    1. Use a different VM
    2. Write your own code to process the http code. Depending on licensing for the VM in use and the VM itself. you might be
    able to find the bug in that code, fix it yourself, and then use your fix (start up command line options for VM.) Otherwise
    you have to duplicate the functionality. You might look to jakarta commons, there might be code there that does that.

  • Automatic Proxy Configuration URL doesn't work on some computers, but Manual proxy can work

    It seems that the Automatic Proxy Configuration URL doesn't work, I use the command netstat -a, can't see the connection to proxy server, but manual proxy is ok, and I tested on some others computers, most of these computers can work normally with Automatic Proxy Configuration URL.
    For the computer can't work normally with Automatic Proxy Configuration URL, I did below actions
    1.Clear the cache
    2.update the version of firefox
    3.reinstall the firefox
    4.use the safemode to run firefox
    but unfortunately, still doesn't work.
    Can some dear friends give me a big favor for this? Thanks a million in advance!

    I have the same problem, just showed up recently - very fricking annoying!!

  • Enter key doesn't work when typing in url

    I recently updated my Firefox to 4.0. And now, when I type in url's into the location bar, I can no longer press enter on my keyboard to launch the website. I have to go up to the green arrow to make it go to the webpage. But when I launch firefox in safe mode, without any of the add-ons enabled, it works. I've tried disabling all the add-ons while normally using firefox but it doesn't work still. I've even uninstalled, and re-installed firefox to see if it would help but it still doesn't work.

    yep it's the AVG add-on. stupid thing to troubleshoot.

Maybe you are looking for

  • $1,400 Overpriced, huge price drop very soon?

    I've wanted a MacBook Pro for quite a while now. The only things that are holding me back are: MBPs need a much better video card and the price. I was looking at Dell (don't worry, my next computer will be a Mac) and the Inspiron 1720 with: Intel® Co

  • About Installation :/

    Hey, Guys  im having problem with installing the Sync software to connect my blackberry storm 9530. the problem is when i install the software, an error occurs. the error says that i have to install .Net Framework 3 or 3.5 don't remember.. so well wh

  • Help! Unreconciled Stopped Payment affecting Control Totals

    All, I have an issue in Oracle Cash Management (Bank Recon) where a stopped payment was reconciled which created a Receipt Line and updated the Amount in the Line Totals. This created an imbalance between the Control Totals and the Line Totals, so th

  • Discovery response message header encapsulation failed

    Hey All, i get this from an AP any ideas why this may be happening? Last Error Occurred Failed to send Lwapp discovery response Last Error Occurred Reason Discovery response message header encapsulation failed Last Join Error Timestamp Sep 19 15:56:3

  • Email doesn't show "All Inboxes"

    Hi I just had to get a new phone and now, even when turned on, my email doesn't have an all inboxes smart folder. How do I get the folder to show up? Post relates to: Pixi Plus p121vzw (Verizon)