Help please: URLConnection and timeout

I want to connect to a Internet URL and retrieve the HTML code, but I have error message: "Operation timed out: connect"
How I can resolve this?
Thanks.
<%
try {
URL theUrl = new URL("http://www.yahoo.com");
URLConnection uc = theUrl.openConnection();
InputStream content = uc.getInputStream();
BufferedInputStream in = new BufferedInputStream (content);
LineNumberReader lnr = new LineNumberReader (new InputStreamReader(in));
String tempStr = "";
StringBuffer str = new StringBuffer();
while ((tempStr = lnr.readLine()) != null)
str.append(tempStr);
out.println(tempStr);
in.close();
lnr.close();
catch(Exception e) { out.println("Error:"+e.getMessage()); }
%>

I was getting the same error while connecting through a proxy.
The following lines fixed the problem:
System.setProperty("http.proxyHost", "[your proxy's IP]");
System.setProperty("http.proxyPort", "[your proxy's port]");
Good Luck
matrixPooh www.bizdisplay.com

Similar Messages

  • Help please, combining AND filters with OR filters

    I have this application I am working on: http://webbymgc.com/tomato/
    It's working fairly well EXCEPT, and this is a big except: selectors WITHIN each fieldset should be "or" but BETWEEN fieldsets as "and"
    In other words, clicking "red" and "yellow" in "color" should get you both kinds of tomatoes.  This is how I set it up.
    Now, if you check "class" = "heirloom" is adds all the ones that match that term, so you get more tomatoes.  I would like "heirloom" to be an "AND" so the user would get yellow or red heirloom tomatoes.
    Make sense? 

    mr kglad i really hope my ( too many replies and questions ) don't bother you.. but please excuse me if they sound foolish or something im a beginner as mentioned...
    There must be something wrong with whatever im doing ... ( im so desperate and since you are the only one who replied on me i really need your help please.. )
    1- i published the first fla as a swf (10.3 ) with a button with the code you've given me )
    2- i published the second fla as a swf (10.3) with another button with the same code you've given me )
    3- i made a main page where there are two buttons.. one for english and one for foreign language
      English button with this code :
    Engbutton.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_4);
    import fl.display.ProLoader;
    var fl_ProLoader_4:ProLoader;
    //This variable keeps track of whether you want to load or unload the SWF
    var fl_ToLoad_4:Boolean = true;
    function fl_ClickToLoadUnloadSWF_4(event:MouseEvent):void
        if(fl_ToLoad_4)
            fl_ProLoader_4 = new ProLoader();
            fl_ProLoader_4.load(new URLRequest("englishformFIN.swf"));
            addChild(fl_ProLoader_4);
        else
            fl_ProLoader_4.unload();
            removeChild(fl_ProLoader_4);
            fl_ProLoader_4 = null;
        // Toggle whether you want to load or unload the SWF
        fl_ToLoad_4 = !fl_ToLoad_4;
    and the other button with the same code ( the second fla )
    IT DOESNT WORK WHEN I TEST THE MOVIE.. the return buttons nor the main ones..why why why why why... ???
    i really need your help
    THANK YOU in advance

  • If anyone could Help Please, Variables And just how they work

    I think I may have taken on a bit more than i can handle with this project.
    I have been asked to create a "Picture in Picture" situation, What i am wanting is to have the background of the File Static with the food menu consistently rolling over coming from a .txt file so it is easy to change the wording and prices, while having adds (up to 50) running on the other half of the screen cutting in and out of Bloopers. I have seen in done once before and was told it was all done in flash, can anyone please help me out, even a tutorial would be great, I have tried the Variable text to no avail, does this need a starting code??
    Thanks Heaps in Advance

    OK, so i use loadvars("menu.txt","C:\\Documents and Settings\\Owner\\My Documents\\Spot 81"); in the Flash file and what do is use for the txt file? for name1 would i use &name1=Soup Of The Day??  ALso fo you know whatis the best code to call a picture in? Thanks

  • Conservation-help please webdesigners and other help needed

    are you interested in world conservation issues? Would you like to be part
    of a team developing a website that may change the way people act towards
    conservation and may indeed change the future of conservation volunteering
    itself. [email protected] if you are interested a mission plan can be
    obtained from the above address we will see were things go from there. This
    is not a wind up in any way this is -planned to be both a serious tool in
    terms of science and in terms of conersvtaion help mostly in the uk but also
    abroad, the site will have a broad span of features. I need skilled web
    designers and others who can help me market the idea, also once the site is
    set up the way the site works will require a few trusted overseers, it must
    be stressed that the site is none profit making in intent possible small
    amounts may be paid for its construction but these will not be large. Anyone
    interested in helping in the construction of this website will be rewarded
    but further down the line and through simplwe satisfaction of seeing a
    useful and well thought out idea coming to life at their own hands. please
    reply to the sender address or [email protected] please if yopu have any
    inclination do reply we need you as they say , if no one volunteers this
    project wont getr carried out, any help will be greatfully accepted if you
    give me 1hr or 2 of your time i will be very greatful indeed. The website
    being constructed is only in web format because it makes it easy to access
    and it is the easiest medium in which to get setup quickly advertising is
    likely to follow in other mediums and over time the scope of the website as
    explained in the brief which I will send you if you are interested will
    increase and hopefully the good work which comes from that will increase
    also. Thank you for your time
    andrew cuthbert

    are you interested in world conservation issues? Would you like to be part
    of a team developing a website that may change the way people act towards
    conservation and may indeed change the future of conservation volunteering
    itself. [email protected] if you are interested a mission plan can be
    obtained from the above address we will see were things go from there. This
    is not a wind up in any way this is -planned to be both a serious tool in
    terms of science and in terms of conersvtaion help mostly in the uk but also
    abroad, the site will have a broad span of features. I need skilled web
    designers and others who can help me market the idea, also once the site is
    set up the way the site works will require a few trusted overseers, it must
    be stressed that the site is none profit making in intent possible small
    amounts may be paid for its construction but these will not be large. Anyone
    interested in helping in the construction of this website will be rewarded
    but further down the line and through simplwe satisfaction of seeing a
    useful and well thought out idea coming to life at their own hands. please
    reply to the sender address or [email protected] please if yopu have any
    inclination do reply we need you as they say , if no one volunteers this
    project wont getr carried out, any help will be greatfully accepted if you
    give me 1hr or 2 of your time i will be very greatful indeed. The website
    being constructed is only in web format because it makes it easy to access
    and it is the easiest medium in which to get setup quickly advertising is
    likely to follow in other mediums and over time the scope of the website as
    explained in the brief which I will send you if you are interested will
    increase and hopefully the good work which comes from that will increase
    also. Thank you for your time
    andrew cuthbert

  • Etude Ringtone HELP - Please see and Reply

    I was a proud owner of a Nokia 6230 and now I upgraded to a 6230i.
    Guess what the Etude ringtone that was extremely helpful as an ALARM Tone is no longer there. Any help from where i can get it?
    I am not hearing the new alarm resulting in going late to work and risking my job
    Don't let this happen !!!! Please Please
    HELP !!

    I am having the same problem too would like to find out how to fix it ?
    Cheers.

  • Help please gbytes and skype

    Hi there. Please can anyone help me. I'm going to b sky ping on my iPhone for 1 hour 7 days a week and 1 evening an hour, Does anyone know roughly even how many gbytes thus would use up as trying to work out what monthly plan to grand no clue about data usage. Kind regards

    Hi and welcome to the Skype Community,
    It really depends on whether you use audio or video calling, how many contacts you have, how much chatting you perform. Some upper and lower limits are:
    If you are signed in to Skype but not making any calls, Skype will use on average 0-4kbps. When you make a call, Skype will use on average between 24-128kbps.
    https://support.skype.com/en/faq/FA1417/how-much-bandwidth-does-skype-need
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • Begginer needs help please lads and ladettes

    Hi there two things really..... I have a small video booth company in ireland and use prem ele 7 to edit clips for final dvd, normally 120 clips ranging from 15 secs - 45 secs Do i have to drop and drag transitions one at a time or can I drop bulk transitions in for all clips???????
    Also I am editing a scotish/irish weddding at the moment and yup someone lifts there kilt and reveals his manhood aI want to keep clip but wandering if its possible to blur or cover it up????????
    Would really appreciate your thoughts
    Many thanks

    No and yes, Brandon.
    In version 8, Adobe added the ability to add transitions to several clips at once. In version 7, you still have to drop them onto clips one at a time.
    The best way to blur a face (or whatever) is to use the Track Matte. I cover it in my new book, "Cool Tricks & Hot Tips for Adobe Premiere Elements." In fact, the sample chapter I posted to this page includes the how-to for using the Track Matte! If you like it, please think about picking up a copy of the whole book!
    http://Muvipix.com/CoolTricks
    You can also learn a lot about the program with my free Basic Training for Premiere Elements tutorials, also available on Premiere Elements support site http://Muvipix.com (along with hundred of other tips, tutorials, custom-created DVD menus, motion backgrounds and royalty-free music and stock footage clips). We also publish a number of books that are available on Amazon.com and at the Muvipix store.

  • URLConnection and timeout

    hi,
    i read a lot of messages on forum and i just want to know if there is a setimeout method implements in the new java jsk1.4.2 or a plugins?

    I was getting the same error while connecting through a proxy.
    The following lines fixed the problem:
    System.setProperty("http.proxyHost", "[your proxy's IP]");
    System.setProperty("http.proxyPort", "[your proxy's port]");
    Good Luck
    matrixPooh www.bizdisplay.com

  • Help Please IMac and macbook pro Question

    I brought my daughters Imac home for my husband and I to use. We bought her a macbook pro for college.  Her laptop is saying something about not recognizing her informatin because she was using the imac. Does anyone know what I need to do to disconnect her from the Imac so her laptop will work better?

    I think you or her will have to call Apple, should be free 90 phone support on the new one.

  • HELP PLEASE:) confused and sad

    i have lost all of my music since i put my iphone onto my new laptop! where has it all gone?how can i retrieve it, cant even get the music i purchased through itunes    !
    help very much appreciated...totally gutted
    THANKS

    Your music will only be where you put it.
    If you haev a new laptop, then you need to copy everything from your old computer, or your backup copy of your old computer, to your new one.

  • Newbie Needs Help Please - VoIP and VPN

    Hello,
    I have a question about some voip/vpn configuration. I've got two sites that have 1760 routers with fxo/fxs cards that are going to be tieing the two phone systems together with a couple of voip trunks. These are secondary devices on the network with no data traffic or real LAN even, but addressed with a 2nd wan ip on the fa 0/0 port. The only traffic going through these routers is voice/voip.
    My question is about this voip setup with vpn. First off, should I or shouldn't I, or even can I? If I configure a site-to-site vpn connection, will the voip traffic pass over that? How would I set up a VPN tunnel for only the fxo/fxs cards with no "LAN" behind it? Is there a need to have a vpn? Any benefits to sending the voip data across vpn, other than the obvious encryption of the "call"?
    The thing is, I've only setup a VPN with Cisco a few couple of times, and once was from a pre-configured script I found and the other was from some software called SDM. I've only known about setting up VPN's for connecting the LAN behind router A to the LAN behind router B. This setup has NO LAN. The only interfaces are the fa 0/0 (getting static wan ip), and the fxo and fxs cards handling the voice. I have no clue on how to configure a site-to-site VPN for this, or if I even can, or if I should.
    The next two replies will have my voip configuration as it sits on the bench in testing; I have both fa 0/0 interfaces connected to the local LAN just for a connection and testing, but each will later be getting it's own static WAN IP on the fa 0/0 interfaces:

    SITE 1:
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    hostname SITE 1
    boot-start-marker
    boot-end-marker
    enable secret XXX
    no aaa new-model
    voice-card 2
    voice-card 3
    ip cef
    interface FastEthernet0/0
    ip address 192.168.254.30 255.255.255.0
    speed auto
    no shutdown
    no ip http server
    no ip http secure-server
    control-plane
    voice-port 2/0
    connection plar opx 290
    voice-port 2/1
    connection plar opx 291
    voice-port 2/2
    voice-port 2/3
    voice-port 3/0
    connection plar 190
    voice-port 3/1
    connection plar 191
    voice-port 3/2
    voice-port 3/3
    dial-peer voice 180 pots
    destination-pattern 180
    port 2/0
    dial-peer voice 181 pots
    destination-pattern 181
    port 2/1
    dial-peer voice 190 voip
    destination-pattern 19
    session target ipv4:192.168.254.40
    line con 0
    logging synchronous
    line aux 0
    line vty 0 4
    password xxx
    logging synchronous
    login
    transport input telnet
    end

  • Accidentally deleted bonjour from my computer.  iTunes will not open.  Help Please.

    Accidentally deleted Bonjour from my computer.  iTunes will not open.  Running Windows XP. Help please.

    Uninstalling and then reinstalling your iTunes should also get your Bonjour reinstalled.
    For the reinstall, use an installer downloaded from the Apple website:
    http://www.apple.com/itunes/download/
    ... or you could get it back via your Apple Software Update for Windows.
    If you'd prefer not to uninstall iTunes, try the following procedure.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the Bonjour.msi (or Bonjour64.msi) to do a standalone Bonjour install.

  • Multiselect problem Help please!!

    Hi all,
    I am currently using Application Express 3.1.2.00.02 I have developed an online questionnaire with a multiselect list for one of the questions. The problem i am having is that i need each choice to be totaled up separately on the report generated.
    My table of answers looks like this:
    Column name e.g. (Question 9)
    Answer "Dog" "Cat" "Mouse" "Snake" (underneath column name Question 9 depending on what is selected).
    The reporting page would look like below:
    *(Column Question 9)* Count
    Dog 1
    Mouse 1
    Snake 1
    and for the question you could have another respondent who chooses similar of items on the multiselect, so their answer looks like this:
    Answer
    "Question 9" Dog
    "Question 9" Snake
    This would then start a new row on the reporting page like below which is not what i want:
    *(Column Question 9)* Count
    Dog 1
    Mouse 1
    Snake 1
    Dog: Snake 1
    But the report should look like this:
    *(Column Question 9)* Count
    Dog 2
    Mouse 1
    Snake 2
    The current SQLquery i am using is below:
    select "QUESTION 9",
    count(*) c
    from "P1 DQUESTIONNAIRE"
    group by "QUESTION 9"
    Thanks for your help and suggestions,
    'S'

    How to make sure your forum post will never be answered:
    1) Make sure your subject line is completely meaningless (i.e. HELP PLEASE!) and describes no part of your actual problem
    2) State that you are having "a few problems" but make sure to offer no details whatsoever what those problems are or what the symptoms are.
    3) Post large volumes of code instead of distilling the problem down to a compact snippet
    4) For extra points, make the code hard to read by refusing to make use of the "code" tag.

  • Itunes doesn't list all of my recent podcasts. My show is Black Tribbles and it only shows episodes through March 2013, however we do at least two shows a week and they aren't listed. The feed works because the show update to my computer. Help please.

    Itunes doesn't list all of my recent podcasts. My show is Black Tribbles and it only shows episodes through March 2013, however we do at least two shows a week and they aren't listed. The feed works because the show update to my computer. Help please.

    Your feed is at http://blacktribbles.podomatic.com/rss2.xml
    When subscribed to in iTunes the recent episodes show, but the Store hasn't updated for some time.
    There appears to be an issue with the feed. In the episode 'WRESTLING MARCH MADNESS: Final Bracket & Championship' of 31st March you will find in the 'description' tag the following line:
    4. KURT ANGLE
    At the end of this line is an invisible character which seems to be wrecking the feed - although it works OK when suscribing in iTunes it won't load in a browser (and I also found the feed very slow to load, which won't help matters with the Store)
    This sort of thing usually happens when you paste text in from a word processing application and manage to include one of the invisible control characters. I don't know how easy it will be do do it in Podomatic but you should delete that entire line and retype it to remove this charter.
    You should keep an eye on the time it takes the feed to be accessed - if there is a long enough delay (and it was quite some seconds when I tried) the Store may well timeout and fail to read it. At the moment it's showing a cached version from the last time it was able to read it.

  • I keep being asked to update my Safari but when I do a Software update it scans but never gives me a list and just says no new updates. Help please!

    I keep being asked to update my Safari but when I do a Software update it scans but never gives me a list and just says no new updates. Help please!

    There are no updates to either OS 10.5.8 or Safari 5.0.6.
    If you need a later version of Safari you must first upgrade your operating system to a later version of OS X.

Maybe you are looking for