Stuck in an infinate loop

try
     URL temp = new URL(urls);
     BufferedReader bufRed = new BufferedReader(new InputStreamReader(temp.openStream()));
     String stringBuf = "";
     while(!stringBuf.equals(null))
          stringBuf = bufRed.readLine();
          StringTokenizer tok = new StringTokenizer(stringBuf, " ");
          while(tok.hasMoreTokens())
               if(tok.equals(request.getParameter("keyword")))
                    out.println("Found the word(s) "+request.getParameter("keyword")+" in the URL: "+urls[i]);
     bufRed.close();
     }catch(IOException ioe){}
It gets stuck on the while(tok.hasMoreTokens()) loop for ever, does anyone have any ideas to why this is happerning?
Many thanks for any help :)

Thanks for that, it seems to have stopped it from looping, although incorrect output is produced.
try
     URL temp = new URL(urls);
     BufferedReader bufRed = new BufferedReader(new InputStreamReader(temp.openStream()));
     String stringBuf = "";
     while(!stringBuf.equals(null))
          stringBuf = bufRed.readLine();
          StringTokenizer tok = new StringTokenizer(stringBuf, " ");
          while(tok.hasMoreTokens())
               if (tok.nextToken().equals(request.getParameter("keyword")))
                    //if(tok.equals(request.getParameter("keyword")))
                    out.println("Found the word(s) "+request.getParameter("keyword")+" in the URL: "+urls[i]);
          tok.nextToken();
     bufRed.close();
     }catch(IOException ioe){}
If the keyword is for example 'Mez' and the URL is http://www.astonlms.co.uk, shouldn't that print that it has found that keyword in the page its looking at?

Similar Messages

  • HT1414 My Ipad is stuck in an " infinate loop" It goes from the" loading"( white apple on screen) to openning screen. I can slide but can't enter pass code. I let it drain the battery, no good. I have held the buttons, no good, can't enter the pass code

    My Ipad is stuck in an "infinate loop" it goes from the "loading" (white apple) to the openning screen. I can slide to the passcode entery screen but it will not take the passcode. ( when I type it it does not recognize on the screen)

    I suggest try getting it back to your stock iOS and forget about jailbreaking.
    http://support.apple.com/kb/TS1538
    Try a manual install (using DFU Mode), as outlined in the link below.
    Basic troubleshooting steps  
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101
     In Memory of Steve Jobs 

  • I have an Apple ID and trying to sign in for the 1st time on iTunes. When I do, I get the message: "This Apple ID has not been used with the iTunes Store. Please review your account information." When I do, I get stuck in the same loop and can't sign in!

    I have an Apple ID and trying to sign in for the 1st time on iTunes. When I do, I get the message: "This Apple ID has not been used with the iTunes Store. Please review your account information." When I do, it brings me to the same AppleID login window, and I get stuck in the same loop. I never get to the following screen to enter my account info. What's going on?? This is MADDENING!

    If you want to use it, click Review and check your account information.  Or you could contact the store support staff if you are concerned at http://www.apple.com/emea/support/itunes/contact.html for further help.

  • Facebook and add-on page does not open stuck in a infinet loop

    I am able to use other ssl enabled sites like gmail from Firefox, but when I try to login to Facebook after the first page, It does not open. Have tried all the troubleshooting steps suggested for Facebook errors and https errors, no luck.
    I get stuck in an infinite loop on the next page. This is the security page which asks to setup a machine name.. (https://www.facebook.com/loginnotify/setup_machine.php?next)
    Please note there is no error displayed, the page just loops endlessly and does not display the Box which should ask me to set the device name for Facebook.
    The same thing happens when I try the Add -ons page via the Tools menu. I am able to use Facebook in Chrome on the same system system.
    Willing to work with the community to resolve this. Can also provide Wire shark dumps if required. Thank you for your time. Hope this gets resolved soon.

    Hi Matthew,
    Thank you for your question, I am sorry of the challenge as you have been at it for a while. [https://support.mozilla.org/en-US/questions/988977] pazos comment had a particular step to clear the cache after applying the update. I followed the mozilla hacks comments as well and saw you were in a loop after
    There was a follow up redit post that was successful from updating to 1.0, then to 1.1 with the update.zip then to 1.2 [http://www.reddit.com/r/FireFoxOS/comments/1xvq2w/how_i_got_12_working_on_zte_open/]
    Did these instructions help?

  • I was told by itunes my phone needed an update to 6.1.2.  I did it, and now my phone is stuck in a reboot loop, and no wifi, phone, or bluetooth.

    I connected my 3gs to my computer, and got a popup from itunes saying there was an update for my phone.  Well i like to keep everything up to date, so I did the update.  After it completed, I no longer have phone, Wifi, and bluetooth.  It also is stuck in a reboot loop.  I really do not know what I can do.  I tried to restore it as a new phone, since i had all my data backed up.
    Any help or ideas is greatly appreciated.

    ccsoh wrote:
    okay i may have called it wrong, we got the unlock from AT&T when our contract was up.  We did this because we were thinking of switching to another carrier.
    I checked the hosts file, and there is nothing refering to gs.apple.com.  Should there be?
    Is it possible to restore it back to 6.1?
    No problem; it's just that many people buy what they think are "factory unlocked" phones, but the "factory" is the back room of the shop where they bought it.
    gs.apple.com should not be in the hosts file (the only reason it might be there is if some hacking tool had been used on the computer in the past; not just jailbreaking tools, but tools to downgrade the OS and perform other unsupported functions).
    You cannot restore back to 6.1; you need to resolve the problem with the latest version. Even if you could revert it would not solve the problem. You need to figure out why iTunes can't communicate with the activation servers. If you have another computer, try restoring on that, or take the phone to an Apple store and let a "genius" deal with it. Or, if your antivirus is Kaspersky, delete it completely, as it's impossible to turn it off completely, and it has taken a dislike to things Apple.

  • My ipod nano 7th generation is stuck in a restore loop with a white screen. Now it won't turn on anymore. What to do?

    My new Ipod Nano 7th generation is stuck in a restore loop. Here is what happened: I added music to it using the latest version of iTunes, the colored bar at the bottom of the summary tab in iTunes showed my that I added it and I disconnected it to listen to the music. As I turned it on, it told me that there is neither music nor pictures on it. So I connected it again to my computer and iTunes told me that I had to restore. Which I did following all the steps but it keep telling me that I need to restore it. After three times of restore it, I disconnected it from my PC and turned it off. Now it won't turn on anymore - even though the battery is fully charged - and when I connect it to iTunes, iTunes tell me "The iPod software updater could not be contacted. The server does not support this version of iTunes." Well, I just downloaded the newest version a couple of minutes ago from the apple website. My iPod stays black. What shall I do?

    Hi clarity,
    Welcome to Apple Support Communities.
    You may want to first try removing and reinstalling the latest version of iTunes by following the steps in this article:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    If you continue to receive the error message when connecting your iPod, see this article for more troubleshooting tips:
    iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    http://support.apple.com/kb/TS1814
    Best,
    Jeremy

  • My iphone 5 is stuck in recovery mode loop for 3 days, can i recover my data before restoring the phone?

    My iphone 5 is stuck in recovery mode loop for 3 days, how can i fix this? I have attempted to reboot by pressing the home and power key at the same time. I have also tried to put in DFU mode and then plugin to my Mac and computer is not recognizing device in itunes.

    i have icloud setup - but my computer broke so i could not plugin to backup to iTunes

  • HT1199 Why is mail stuck in a do-loop of "There is a problem" with the mail account after changing iCloud password?  How can it be fixed?

    After changing passwords for iCloud, Mail is stuck in a do-loop "There is a [problem..."  The error appears in less than one second after responding "Later"

    Nope.  Turns out that even though I have two Macs running 10.9.4, the one in question doesn't get the SMTP settings changed by iCloud settings when the password is changed, so I had to "Edit" the account in Mail, plow down to the password settings for the Apple SMTP server, and change the password myself.  Nothing in the System Preferences iCloud setting tab lets you change any settings on the local machine.  Apple is sure they are controlling everything when you make changes in iCloud, but they are wrong.  Identical versions of 10.9.4 are configured differently on two different Macs.

  • How do I cancel a sub vi stuck in an infinite loop?

    Hi,
    I am attempting an implementation of the Constrained Nonlinear Optimization sub vi.  It works perfectly 99.9% of the time but gets stuck the other .1% of the time.  It is supposed to time out when it cannot find a solution, but it is failing to do so.  Consequently my VI regularly crashes.
    Apparently this is a known issue with this subvi.  The NI whitepaper mentions that this is caused by a subvi while loop that can get stuck in an infinite loop.  The work around is suggested to be to add a counter to the loop and exit it after a certain number of iterations.
    I can find the infinite loop occuring in the subvi.  But the sub vi opens as a clone and will not let me edit it.  How do I work around that?
    Failing that, is there a way from the main vi to cancel the optimization vi after a certain time so that the program can move on?
    Suggestions would be appreciated.

    Abort the program. Press ctrl+M when you have VI opened as clone. This will open it in edit mode.

  • Igxprd 32, device driver stuck in an infinite loop

    Just attempted to reset a hard drive on our T61 to its factory settings (Windows XP) using the "Recovery CD Set"  (rescue and recovery cd, supplemental product recover cd, and 6 product recovery cd's).  During the final step, the computer reboots itself; however, Windows can't load.  I keep getting an error on a small blue screen, referencing a problem with "igxprd32" and that the device driver got stuck in an infinite loop.  How can I fix this issue.  (Product ID 6465CT0)  Thank you!

    Kindly try to boot the system into Safe mode and then uninstall the display driver.
    After this you should able too boot the system into normal mode. Download the latest driver from lenovo website
    http://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles/7ld152ww.exe
    Best Regards,
    Tanuj
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution".! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • I have an iPhone 4 that is stuck in a recovery loop. i try to restore it but it comes up with an error code (-1) towards the end of the restore. can someone please help me?

    i have an iPhone 4 that is stuck in a recovery loop. i try to restore it but it comes up with an error code (-1) towards the end of the restore. can someone please help me?

    i just baught it off someone.. so im unsure if it was jailbroken or not.. and i dont think its under warranty now.
    is there a software or something along those lines that would indicate what peice of hardware is faulty?
    i baught it in this recovery loop thinking it was going to be a cheap way of getting a new phone without having to do much.. but now im starting to think its a brick

  • O2wifi can't connect / stuck in a login loop

    Does anyone else have trouble signing in to O2wifi. I just get stuck in an endless loop ?
    It recognises me "Hi Luke, welcome back", says press here to continue, does the grey circles, and then returns to the start.
    I'm using a HTC M8one, running android 5.0.1. I've got the O2wifi app installed and registered. I've failled to log-in everywhere from McDonald's, to Costa, even at the O2 shop!

    viridis wrote:
    rosadosc wrote:
    Hi @lukew151 Have you tried removing the connection (making your phone forget) to the O2 wifi and searching again?Unfortunately if it's one of the modern devices you cant . O2 wifi will be a permanent connection as i myself just found out...It's hard wired if you have o2 firmware on your phone.

  • My LG G3 gets stuck in an "updating" loop and not load new emails. How do I fix this?

    My LG G3 gets stuck in an "updating" loop and not load new emails. How do I fix this?

    If you toggle Airplane mode On/Off, does it resolve?

  • Server 2012 R2 Essentials stuck in Automatic repair loop on every reboot

    We are running Windows Server 2012 R2 Essentials on a brand new Dell PowerEdge T110. Nothing new has been installed or are we running any special software. This server is a doing DHCP, Domain Controller and DNS. It is also intergrating the Office365. 
    I am assuming a windows update did this but i cannot pinpoint when exactly this happened and which update since it was a couple months ago. But everytime we try to reboot this server it goes to that Windows 2012 repair screen and asks us if we want to troubleshoot.
    I am able to break this loop by going into safe more and then rebooting but this doesnt fix it, it only allows us to then boot windows normally once after that. But this can only be done when we are onsite and not remotely so we havent rebooted this server
    or ran new windows updates in quite some time.
    Any help or input would be appreciated.
    Thank You

    Hi,
    On current situation, please use Bootrec.exe to troubleshoot this issue. for more details, please refer to
    the following KB.
    Use Bootrec.exe in the Windows RE to troubleshoot startup
    issues
    Meanwhile, please refer to the following similar thread and check if can help you.
    Windows
    Server 2012 essentials stuck in automatic repair loop
    Hope this helps.
    Best regards,
    Justin Gu

  • Hello i have an iphone 4 its stuck in the apple loop. when ever i unplug it from the computer it shuts down and when i plug it in it shows me on itunes its in recovery mood and every time i click restore i get this error the iPhone could not be restored.

    hello i have an iphone 4 its stuck in the apple loop. when ever i unplug it from the computer it shuts down and when i plug it in it shows me on itunes its in recovery mood and every time i click restore i get this error the iPhone could not be restored.an unknown error accurred (2001)

    Error 1 or -1
    This may indicate a hardware issue with your device. Follow Troubleshooting security software issues, and restore your device on a different known-good computer. If the errors persist on another computer, the device may need service.
    http://support.apple.com/kb/TS3694#error1

Maybe you are looking for

  • Keeps coming up with "What's New" page everytime I open Firefox.

    Everytime I open Firefox (5) it keeps checking whether my add-ons would work with it and then opens the "What's New" page. It's starting to get really irritating. Is there a way to stop it from doing this?

  • Problem in Internet Explorer

    Dear all I have just completed my first JavaFX animation which I have tried to upload to my website. I used NetBeans to make it, set the program properties to "browser" mode and copied the contents of the "dist" folder to my website (also renaming th

  • Sparse Bundle Images on external NTFS formatted drive

    I'm currently in the process of re-arranging my own backup setup following on from my recent update to Snow Leopard. For this purpose i have the lend of a NTFS formatted external drive and used a large Sparse bundle disk image. Under 10.5.7 with the

  • Export License assignment

    Hi, I am creating new material in R3 side and transfered to GTS system. Please let me know License assignment for this new product in GTS is automatic process or manually we need to assign the license for each material if it is automatic kindly let m

  • Version Of Enterprise portal

    Hi Team How can we find the version of Enterprise Portal Thanks and regards Madhu