Problem with HTML Parser and multiple instances

I have a parser program which queries a online shopping comparison web page and extracts the information needed. I am trying to run this program with different search terms which are created by entering a sentence, so each one is sent separately, however the outputs (text files) are the same for each word, despite the correct term and output file seeming passed. I suspect it might be that the connection is not being closed each time but am not sure why this is happening.
If i create an identical copy of the program and run that after the first one it works but this is not an appropriate solution.
Any help would be much appreciated. Here is some of my code, if more is required i will post.
To run the program:
StringTokenizer t = new StringTokenizer("red green yellow", " ");
        int c = 0;
        Parser1 p = new Parser1();
        while (t.hasMoreTokens()) {
            c++;
            String tok = t.nextToken();
            File tem = new File("C:/"+c+".txt");
                p.mainprog(tok, tem);
                p.mainprog(tok, tem)
                p.mainprog(tok, tem);
}The parser:
import javax.swing.text.html.parser.*;
import javax.swing.text.html.*;
import javax.swing.text.*;
import java.awt.*;
import java.util.*;
import javax.swing.*;
import java.io.*;
import java.net.*;
public class Parser1 extends HTMLEditorKit.ParserCallback {
    variable declarations
   public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos){
...methods
  public void handleText(char[] data, int pos){
       ...methods
  public void handleTitleTag(HTML.Tag t, char[] data){
  public void handleEmptyTag(HTML.Tag t, char[] data){       
  public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos){
...methods
      static void mainprog(String term, File file) {   
...proxy and authentication methods
                    Authenticator.setDefault(new MyAuthenticator() );
                    HTMLEditorKit editorKit = new HTMLEditorKit();
                    HTMLDocument HTMLDoc;
                    Reader HTMLReader;
                  try {
                        String temp = new String(term);
                        String fullurl = new String(MainUrl+temp);
                        url = new URL(fullurl);
                        InputStream myInStream;
                        myInStream = url.openConnection().getInputStream();
                        HTMLReader = (new InputStreamReader(myInStream));
                        HTMLDoc = (HTMLDocument) editorKit.createDefaultDocument();
                        HTMLDoc.putProperty("IgnoreCharsetDirective", new Boolean(true));
                        ParserDelegator parser = new ParserDelegator();
                        HTMLEditorKit.ParserCallback callback = new Parser1();
                        parser.parse(HTMLReader, callback, true);
                        callback.flush();
                        HTMLReader.close();
                        myInStream.close();
                 catch (IOException IOE) {
                    IOE.printStackTrace();
                catch (Exception e) {
                    e.printStackTrace();
      try {
            FileWriter writer = new FileWriter(file);
            BufferedWriter bw = new BufferedWriter(writer);
            for (int i = 0; i < vect.size(); i++){
                bw.write((String)vect.elementAt(i));
                if (vect.elementAt(i)!=vect.lastElement()){
                    bw.newLine();
            bw.flush();
            bw.close();
            writer.close();
        catch (IOException IOE) {
                    IOE.printStackTrace();
                catch (Exception e) {
                    e.printStackTrace();
          }   catch (IOException IOE) {
                 System.out.println("User options not found.");
}

How many Directory Servers are you using?
Are both serverconfig.xml files of PS instances the same?
Set debug level to message in the appropriate AMConfig.properties of your portal instances and look into AM debug files.
For some reason amSDK seems not to get the correct service values.
-Bernhard

Similar Messages

  • Problems with Sent mail and multiple accounts on the same server

    I have 2 different email accounts that are on the same server. Regardless of the account from which I send the email, all of the sent messages end up in the same sent folder. Is there a way to force the sent messages to go into their correct Sent folder?

    In the Finder, go to ~/Library/Mail/. With that folder open, do Edit > Select All (⌘A), then Edit > Copy (⌘C), and paste it in your reply to this post, to let me see the names of the files and folders present at the root level of the Mail folder.
    Before actually posting that information, you may edit it so that the file/folder names do not reveal any details you wish to keep private, e.g. you may replace any real username with "username" to hide your real email address if you wish; similarly, you may disguise any domain names you don't want to be revealed. Try to be consistent in how you disguise those details, though, as we may need to refer to them in subsequent posts.
    Now, go to ~/Library/Mail/Mailboxes/. With that folder open, repeat the process to let me see the names of the files and folders it contains. Again, you may disguise any mailbox names you wish to keep private. Be careful to not alter any suffixes, though.
    Finally, for the two accounts involved in the problem, locate the account folders within ~/Library/Mail/ -- their name begins with the account type (POP, IMAP, Mac), followed by the account username and the incoming mail server. For each account folder, repeat the process to let me see the names of the files and folders it contains.
    Note: For those not familiarized with the ~/ notation, it refers to the user's home folder. You can easily locate any of the folders referred to in this post by copying the file path here, doing Go > Go to Folder in the Finder, and pasting the file path there.

  • Problem with html table and htmlb radiobutton group

    Hello,
    I wrote this code:
           <table width="100%" border="1">
            <tr>
              <th>
                Valutazione manageriale complessiva dell#anno
              </th>
              <th>1</th>
              <th>2</th>
              <th>3</th>
            </tr>
            <tr>
              <th>
                imprenditività
              </th>
              <htmlb:radioButtonGroup id="PROVA1"
                                       columnCount="3"
                                        mode="LOGICAL_GROUPING">
              <th><htmlb:radioButton id="1" text="1"  encode="TRUE"/></th>
              <th><htmlb:radioButton id="2" text="2"  encode="TRUE"/></th>
              <th><htmlb:radioButton id="3" text="3"  encode="TRUE"/></th>
              </htmlb:radioButtonGroup>
            </tr>
            <tr>
              <th>
                Autorevolezza
              </th>
              <htmlb:radioButtonGroup id="PROVA2"
                                       columnCount="3"
                                        mode="LOGICAL_GROUPING">
              <th><htmlb:radioButton id="1" text="1"  encode="TRUE"/></th>
              <th><htmlb:radioButton id="2" text="2"  encode="TRUE"/></th>
              <th><htmlb:radioButton id="3" text="3"  encode="TRUE"/></th>
              </htmlb:radioButtonGroup>
            </tr>
          </table>
    but the third row (where there is "Autorevollezza/PROVA2") appears out of the table.
    Do yuo now why?
    Regards
    Maria

    you need to put the htmlb:radioButtonGroup Tags within the
    tags
    <tr>
    <td>
    imprenditività
    </td>
    <td>
        <htmlb:radioButtonGroup id="PROVA1" columnCount="3" mode="LOGICAL_GROUPING">
        <htmlb:radioButton id="1" text="1" encode="TRUE"></htmlb:radioButton></td>
    <td><htmlb:radioButton id="2" text="2" encode="TRUE"></htmlb:radioButton></td>
    <td><htmlb:radioButton id="3" text="3" encode="TRUE"></htmlb:radioButton>
         </htmlb:radioButtonGroup></td>
    </tr>
    there is a invisible table rendered by htmlb and the browser does not know what to do when you put that between </tr> and </table> so he ends your table...
    better you use <htmlb:gridLayout> instead of html-tables...
    stefan

  • Problems with Mail, Safari and iTunes after updating to 10.5.6

    Hi all,
    after installing 10.5.6 I have problems with Mail, Safari and iTunes.
    The time to open mails, websides and iTunes store is increasing dramatically since the update. If I open a webside parallel with Safari and Firefox, Safari needs minimum 15 times longer to open the complete side. Mails containing HTML-code also needs a long time to be opened. Tha same Problem with iTunes store. Connecting to the Store costs at least 30 - 40 seconds. And unfortunately for every iTunes store side I open. Its terrible
    Any idea or workaroung to solve that problem?
    Regards
    Michael

    First, run Disk Utility and repair permissions and then restart.
    I installed the 10.5.6 Combo update. Sometimes things get "lost in the translation" when you use Software Update depending on your installation. Perhaps you can download 10.5.6 Combo from the website and install it from your desktop.

  • Problems with the richTextEditor and quotes

    Hello
    I'm having problems with quote chars and the richText
    control's htmlText. When users enter quotes into the richTextEditor
    control. The quotes breaks the HTML text, meaning it's no longer
    well formatted. Is there an escape char that I need to use. Or do I
    need to force some kind of refresh on the control prior to using
    the htmlText string?

    I have been using RTE in a content management system and
    found a need to replace non-standard quote characters with proper
    UTF-8 character counterparts. Curly quotes in particular are
    problematic. Use a replace function to substitute non-standard for
    standard characters.

  • Problem with special characters and xmldom.writetoclob

    Hi!
    I have a problem with oracle parser in pl/sql.
    My situation:
    i have a clob with valid xml with for example decoded characters:
    (spaces between & and # are for good representing characters by browser - in really there is no spaces)
    <xml>
    <any><![CDATA[ & #187; ]]> text <![CDATA[ & #187; ]]></any>
    </xml>
    i read this xml from clob, parse it and put into another clob by using
    xmldom.writetoclob procedure.
    And in second clob i have"
    <xml>
    <any>& #38;#187; text & #38;#187; </any>
    </xml>
    (ampersand is representing as & #38; !) Why there is not the cdata sections ?
    Why the value of these sections changed?
    Any ideas? I'm using newset xdk (9202) in 8.1.7.3 database.
    Please help!

    Hi John,
    According to your description, my understanding is that the Author showed incorrect character in SharePoint 2013 search result page.
    I tested the same scenario per your post in my environment, and the Müller showed correctly in SharePoint search result page.
    I recommend to reset the index in Search Service Application and run a full crawl to see if the issue still occurs.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Problems with html content in box

    Hi! I have a problem with html content. For example photoswipe. If I import the folder with the index.html of photoswipe as an article all works fine. If I link it trough the folio overlay creator/webcontent) into a box in indesign dps, it stays empty. Seems like it doesnt find the images/paths??
    Klaus

    This sounds familiar. PhotoSwipe doesn't seem to like working in a web content overlay unless the JavaScript and other source files are uploaded within HTMLResources. This means editing your local HTML file so that paths to the JavaScript, images and CSS files begin by pointing to HTMLResources virtual folder (../../../HTMLResources/) before their subfolder and filenames. It's worth a try.

  • Email with html body and a pdf attachment

    Hi,
    i try to send a email with html body and one attach in pdf
    in release 4.6c using the SO_DOCUMENT_SEND_API1.
    I've put the html in the txt table and the pdf in bin table but i obtain the following situation:
    1) with only the html in the body i see a right email in html
    2) with the html body AND the pdf attach i obtain a empty mail with two attach.
    what can i do ? I's possible to do this.
    Thanks in advance.

    Contact my basis guy is a problem !!
    maybe a need a function similar to SX_OBJECT_CONVERT_RAW_TXT to convert raw (containing html text) into real html ?
    my view V_SXCONV contain:
    ALI     HTM     2     SX_OBJECT_CONVERT_ALI_HTM
    ALI     PS     4     SX_OBJECT_CONVERT_ALI_PRT
    ALI     RAW     1     SX_OBJECT_CONVERT_ALI_RAW
    ALI     TXT     2     SX_OBJECT_CONVERT_ALI_TXT
    ICS     RAW     8     SX_OBJECT_CONVERT_ICS_RAW
    INT     RAW     8     SX_OBJECT_CONVERT_INT_RAW
    OBJ     HTM     2     SX_OBJECT_CONVERT_OBJ_HTM
    OTF     PCL     3     SX_OBJECT_CONVERT_OTF_PRT
    OTF     PDF     1     SX_OBJECT_CONVERT_OTF_PDF
    OTF     PS     2     SX_OBJECT_CONVERT_OTF_PRT
    OTF     RAW     9     SX_OBJECT_CONVERT_OTF_RAW
    RAW     SCR     6     SX_OBJECT_CONVERT_RAW_SCR
    RAW     TXT     7     SX_OBJECT_CONVERT_RAW_TXT
    SCR     OTF     1     SX_OBJECT_CONVERT_SCR_OTF
    TXT     INT     7     SX_OBJECT_CONVERT_TXT_INT
    URL     HTM     2     SX_OBJECT_CONVERT_OBJL_HTM
    thanks a lot.

  • Problem with SimpleDateFormat.parse()

    Hello
    I have a problem with the parse-function in SimpleDateFormat.
    When i try to parse the date Fri Jul 15 17:23:41 2005 with this pattern EEE MMM d HH:mm:ss yyyy i get the exception java.text.ParseException: Unparseable date: "Fri Jul 15 17:23:41 2005".
    This is my code:
    SimpleDateFormat df=new SimpleDateFormat("EEE MMM d HH:mm:ss yyyy");
    try {
      df.parse(strDate);
    } catch (ParseException e) {
      e.printStackTrace();
    }Can someone explain me what i did wrong?
    Thanks
    Matthias

    Since your name is "Matthias" it is possible that your locale is one that does not use the English language. If that is the case then your problem is that "Fri" or "Jul" are not correct abbreviations in your language.
    Easiest way to test this idea is to format a date (such as now) using that SimpleDateFormat object and see what the output looks like.

  • HT1338 problems with time  machine and parallels desktop,  mac osx mountain lion 10.8

    have a good day, i have been problems with time  machine and parallels desktop, dont work in mac osx 10.8, i upgrate two mac´s (macbook air, imac), in the two machines shows problems, could you help me please.
    two machines have good ram memory (macbook air 11.1 2010 early , imac 2009 late).
    i am waiting for your help.
    thanks.
    Jesus.

    Take a look here:
    http://pondini.org/TM/Troubleshooting.html
    Specifically, you'll probably want to try item #A5 on that page, but there's a lot of other info there that may be useful.

  • Problem with m3u files and Quicktime

    Hello:
    I have made one update with Quicktime software (version 7.6.9 1680.9). The problem is that Quicktime player reproduces mp3 files but when I try to play m3u files the sound is very bad. It sounds like gargling.
    For example: This files play ok:
    http://www.telefonica.net/web2/sevarra/Sarabande.mp3
    It plays ok when the previous link is introduced as URL address in Quicktime player, but the corresponding m3u files sounds like gargling
    http://www.telefonica.net/web2/sevarra/list0.m3u
    I think there a problem with m3u files and Quicktime.
    Tank you very much and best regards.

    I have discovered that when the URL is playing (with gargling sound) if I open the A/V controls in QT menus and I move the Jog Shuttle or the Speed level then the sound becomes good.
    Yes! Great catch, ttfrank. I can replicate that too.
    Interesting ... if (after getting the sound working properly again) you then pause play of the m3u, and start it again, you get the gargling/dalekish sound quality back again.
    Bug reporting ... there's a couple of ways you can go about doing this. You can use the QuickTime product feedback form:
    http://www.apple.com/feedback/quicktime.html
    ... but if you want to track progress on the bug, try instead registering as an Apple Developer (for free):
    http://developer.apple.com/programs/register/
    ... and then you'll be able to submit the bug via the Apple Bug Reporter:
    http://developer.apple.com/bugreporter/
    In the meantime, there's also a restricted forum available to level 4 and 5 members ("Notable New Technical Issues") where we can report this sort of thing. I'll try to get a post written up on the topic there later today.

  • Diff between Multiple Threading and Multiple instance.

    Hi ,
    what is the main diff between Multiple Threading and Multiple instance?
    Please give me the answer

    Satti4Java wrote:
    Hi ,
    what is the main diff between Multiple Threading and Multiple instance?The main difference (not "diff") is that the first one ends with the word "Threading" and the second one ends with the word "instance".
    Really. Seriously. Now if you had some industry standard phrases you were comparing, there might be a useful discussion. But those are just words strung together. If that's a homework question, I recommend you find a different teacher.

  • Since upgrade to ios6 l have been having problem with wifi connection and connecting to App Store and iTunes store

    Q since upgrade to iOS6 l have been having problem with wifi connection and getting into App Store and itunes

    Saw this on another post.
    Applecare Senior Advisor Txx Bxxx (I have his contact info in an email he just sent) just confirmed with me that the problem people are having with the App Store not loading is an apple issue with there servers, ITS NOT YOUR IPAD so don't go restoring it!   It's not happening to everyone however but they are looking into it, its really hit or miss.
    In the meantime ...........
    The Complete Guide to Using the iTunes Store
    http://www.ilounge.com/index.php/articles/comments/the-complete-guide-to-using-t he-itunes-store/
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Best Fixes for ‘Cannot Connect to iTunes Store’ Errors
    http://ipadinsight.com/ipad-tips-tricks/best-fixes-for-cannot-connect-to-itunes- store-errors/
    Try this first - 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 - let go of the buttons.
    This works for some users. Not sure why.
    Go to Settings>General>Date and Time> Set Automatically>Off. Set the date ahead by about a year.Then see if you can connect to the store.
    ~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting
    http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet
    http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    Another thing to try - Go into your router security settings and change from WEP to WPA with AES.
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Problem with Group policies and Administrator count

    I have one problem with Group policies and Admnistrator count.
    Win XP, Client 4.91, Client Zen 4
    I use DLU for users.
    the Group policies are well applied and i keep them after logout for
    security reasons.
    But my problem is, after logout, the Administrator count becomes this
    Group policies, and the only technique that I use, is to remove the
    repertories c:\windows\system32\GroupPolicy*. Administrator must
    loguing again for having good policies.
    Can you help me?

    Bill,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Flash Player 10, strange problem with emdedded fonts and movieclips

    Hello, developers! I have a big problem with font embedding
    and I can not debug it myself. So I need you help.
    I' ve done a simple list of attached movieclips with
    textfields inside them, with embedded fonts. I have no problem with
    flash player 9 in order to see the list, but in flash player 10 I
    can't see it. The font is very common, Arial actually so you can
    test it very easily. I am using a font symbol in the library, a
    class and an xml file for my data.
    Also you can see it online in (if you have flash player 10
    you can't see a thing)
    http://www.forestonfire.com//research/flash/fontproblem/index.html
    I have compiled the file as an exe projector in order to see
    it as I do in flash player 9
    http://www.forestonfire.com//research/flash/fontproblem/fontinflash9.zip
    I have zipped also the source code in order to compile it
    yourself.
    http://www.forestonfire.com/research/flash/fontproblem/fontembedded.zip
    and the same example without embedded fonts (I have the same
    problem there so perchaps are not the fonts)
    http://www.forestonfire.com/research/flash/fontproblem/fontnotembed.zip
    Please, check it and tell me if there is a solution
    available. Thank you in advance.

    I've included also a much more simple example without the xml
    and the font symbol, only the class and a movieclip from the
    library, but I can't still see it on flash player 10
    http://www.forestonfire.com/research/flash/fontproblem/simplyfied.zip
    I have no clue about this problem.

Maybe you are looking for

  • How to create a default profile for all users in Firefox 9.

    I run a computer lab, and am looking for a way to create a default profile in Firefox 9 that new users can use. I want them to be able to launch Firefox for the first time, and see my homepage. I want to disable any check for default browsers, firstr

  • Pdf file sizes in RoboHelp 8

    Hi, I just received the trial of the Adobe Technical Communication Suite 2 and installed properly the RoboHelp8. I checked several things with it and what I found is that the pdf generated from Word are bigger then the RoboHelp7. Is there any way to

  • Format numbers with leading zeros

    Hi, Im returning the time as a string from a function like so return minutes + ":" + seconds + ":" + millisec; But I need each part to always display with two digits and show leading zeros. Can anyone tell me how Thanks

  • Problem in changing end date of PA-Infotype using HR_INFOTYPE_OPERATIONS .

    Hi All, I am trying to change the end date of an active record in an infotype using HR_INFOTYPE_OPERATIONS FM. But am getting an error, 'Infotype does not exist'. I am using operation as 'MOD' and passing appropriate parameters as required. it would

  • Apple OS 10.5.8 on new macs that came with Snow Leopard!

    I want all who read this to know that I am and have been using OS 10.5.8 on my Imac 21.5" core 2 duo that came with 10.6 Snow Leopard. Everyone at Apple said it could not work but that is wrong. I am running OS 10.5.8 in a Bootcamp partitian with gre