Importing Word docs from RH for Word X5 - out of memory error

I've tried a few times to import 537 Word docs (2,974) from a
RH for Word project (RH X5 for Word, CHM output) into a new RH HTML
5 project. Each time, RH HTML "hangs" and I've seen "out of memory"
at least once at the very end. The original RH for Word project has
conditional build tags defined, but only one tag has been assigned
to one topic, so far. We've never been able to build an index in
this RH for Word project (it's mostly blank), but we've built a
search and contents without problems.
Is an error related to Word? Is it a bug that was fixed for
version 6? Is it somehow related to this fix:
http://kb.adobe.com/selfservice/viewContent.do?externalId=kb401651&sliceId=1?
If it's a known bug that was fixed with a later version, then
it would further help me build a case for converting to RH 7, with
the end result of converting the whole thing eventually to RH HTML.
Thanks,
Jim

I don't do much import but if you are trying to import 537
documents in one go, nothing would surprise me. Have you tried one
at a time or a small batch at a time?
The bug you point to arose in 6 and was fixed so it is not
relevant.
My guess is it is down to memory and that most PCs would
baulk at 537 documents in one go.

Similar Messages

  • Uploading large files from applet to servlet throws out of memory error

    I have a java applet that needs to upload files from a client machine
    to a web server using a servlet. the problem i am having is that in
    the current scheme, files larger than 17-20MB throw an out of memory
    error. is there any way we can get around this problem? i will post
    the client and server side code for reference.
    Client Side Code:
    import java.io.*;
    import java.net.*;
    // this class is a client that enables transfer of files from client
    // to server. This client connects to a servlet running on the server
    // and transmits the file.
    public class fileTransferClient
    private static final String FILENAME_HEADER = "fileName";
    private static final String FILELASTMOD_HEADER = "fileLastMod";
    // this method transfers the prescribed file to the server.
    // if the destination directory is "", it transfers the file to
    "d:\\".
    //11-21-02 Changes : This method now has a new parameter that
    references the item
    //that is being transferred in the import list.
    public static String transferFile(String srcFileName, String
    destFileName,
    String destDir, int itemID)
    if (destDir.equals(""))
    destDir = "E:\\FTP\\incoming\\";
    // get the fully qualified filename and the mere filename.
    String fqfn = srcFileName;
    String fname =
    fqfn.substring(fqfn.lastIndexOf(File.separator)+1);
    try
    //importTable importer = jbInit.getImportTable();
    // create the file to be uploaded and a connection to
    servlet.
    File fileToUpload = new File(fqfn);
    long fileSize = fileToUpload.length();
    // get last mod of this file.
    // The last mod is sent to the servlet as a header.
    long lastMod = fileToUpload.lastModified();
    String strLastMod = String.valueOf(lastMod);
    URL serverURL = new URL(webadminApplet.strServletURL);
    URLConnection serverCon = serverURL.openConnection();
    // a bunch of connection setup related things.
    serverCon.setDoInput(true);
    serverCon.setDoOutput(true);
    // Don't use a cached version of URL connection.
    serverCon.setUseCaches (false);
    serverCon.setDefaultUseCaches (false);
    // set headers and their values.
    serverCon.setRequestProperty("Content-Type",
    "application/octet-stream");
    serverCon.setRequestProperty("Content-Length",
    Long.toString(fileToUpload.length()));
    serverCon.setRequestProperty(FILENAME_HEADER, destDir +
    destFileName);
    serverCon.setRequestProperty(FILELASTMOD_HEADER, strLastMod);
    if (webadminApplet.DEBUG) System.out.println("Connection with
    FTP server established");
    // create file stream and write stream to write file data.
    FileInputStream fis = new FileInputStream(fileToUpload);
    OutputStream os = serverCon.getOutputStream();
    try
    // transfer the file in 4K chunks.
    byte[] buffer = new byte[4096];
    long byteCnt = 0;
    //long percent = 0;
    int newPercent = 0;
    int oldPercent = 0;
    while (true)
    int bytes = fis.read(buffer);
    byteCnt += bytes;
    //11-21-02 :
    //If itemID is greater than -1 this is an import file
    transfer
    //otherwise this is a header graphic file transfer.
    if (itemID > -1)
    newPercent = (int) ((double) byteCnt/ (double)
    fileSize * 100.0);
    int diff = newPercent - oldPercent;
    if (newPercent == 0 || diff >= 20)
    oldPercent = newPercent;
    jbInit.getImportTable().displayFileTransferStatus
    (itemID,
    newPercent);
    if (bytes < 0) break;
    os.write(buffer, 0, bytes);
    os.flush();
    if (webadminApplet.DEBUG) System.out.println("No of bytes
    sent: " + byteCnt);
    finally
    // close related streams.
    os.close();
    fis.close();
    if (webadminApplet.DEBUG) System.out.println("File
    Transmission complete");
    // find out what the servlet has got to say in response.
    BufferedReader reader = new BufferedReader(
    new
    InputStreamReader(serverCon.getInputStream()));
    try
    String line;
    while ((line = reader.readLine()) != null)
    if (webadminApplet.DEBUG) System.out.println(line);
    finally
    // close the reader stream from servlet.
    reader.close();
    } // end of the big try block.
    catch (Exception e)
    System.out.println("Exception during file transfer:\n" + e);
    e.printStackTrace();
    return("FTP failed. See Java Console for Errors.");
    } // end of catch block.
    return("File: " + fname + " successfully transferred.");
    } // end of method transferFile().
    } // end of class fileTransferClient
    Server side code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.net.*;
    // This servlet class acts as an FTP server to enable transfer of
    files
    // from client side.
    public class FtpServerServlet extends HttpServlet
    String ftpDir = "D:\\pub\\FTP\\";
    private static final String FILENAME_HEADER = "fileName";
    private static final String FILELASTMOD_HEADER = "fileLastMod";
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException,
    IOException
    doPost(req, resp);
    public void doPost(HttpServletRequest req, HttpServletResponse
    resp)
    throws ServletException,
    IOException
    // ### for now enable overwrite by default.
    boolean overwrite = true;
    // get the fileName for this transmission.
    String fileName = req.getHeader(FILENAME_HEADER);
    // also get the last mod of this file.
    String strLastMod = req.getHeader(FILELASTMOD_HEADER);
    String message = "Filename: " + fileName + " saved
    successfully.";
    int status = HttpServletResponse.SC_OK;
    System.out.println("fileName from client: " + fileName);
    // if filename is not specified, complain.
    if (fileName == null)
    message = "Filename not specified";
    status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    else
    // open the file stream for the file about to be transferred.
    File uploadedFile = new File(fileName);
    // check if file already exists - and overwrite if necessary.
    if (uploadedFile.exists())
    if (overwrite)
    // delete the file.
    uploadedFile.delete();
    // ensure the directory is writable - and a new file may be
    created.
    if (!uploadedFile.createNewFile())
    message = "Unable to create file on server. FTP failed.";
    status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    else
    // get the necessary streams for file creation.
    FileOutputStream fos = new FileOutputStream(uploadedFile);
    InputStream is = req.getInputStream();
    try
    // create a buffer. 4K!
    byte[] buffer = new byte[4096];
    // read from input stream and write to file stream.
    int byteCnt = 0;
    while (true)
    int bytes = is.read(buffer);
    if (bytes < 0) break;
    byteCnt += bytes;
    // System.out.println(buffer);
    fos.write(buffer, 0, bytes);
    // flush the stream.
    fos.flush();
    } // end of try block.
    finally
    is.close();
    fos.close();
    // set last mod date for this file.
    uploadedFile.setLastModified((new
    Long(strLastMod)).longValue());
    } // end of finally block.
    } // end - the new file may be created on server.
    } // end - we have a valid filename.
    // set response headers.
    resp.setContentType("text/plain");
    resp.setStatus(status);
    if (status != HttpServletResponse.SC_OK)
    getServletContext().log("ERROR: " + message);
    // get output stream.
    PrintWriter out = resp.getWriter();
    out.println(message);
    } // end of doPost().
    } // end of class FtpServerServlet

    OK - the problem you describe is definitely what's giving you grief.
    The workaround is to use a socket connection and send your own request headers, with the content length filled in. You may have to multi-part mime encode the stream on its way out as well (I'm not about that...).
    You can use the following:
    http://porsche.cis.udel.edu:8080/cis479/lectures/slides-04/slide-02.html
    on your server to get a feel for the format that the request headers need to take.
    - Kevin
    I get the out of Memory Error on the client side. I
    was told that this might be a bug in the URLConnection
    class implementation that basically it wont know the
    content length until all the data has been written to
    the output stream, so it uses an in memory buffer to
    store the data which basically causes memory issues..
    do you think there might be a workaround of any kind..
    or maybe a way that the buffer might be flushed after
    a certain size of file has been uploaded.. ?? do you
    have any ideas?

  • Oracle Service Bus For loop getting out of memory error

    I have a business service that is based on a JCA adapter to fetch an undertimed amout of records from a database.  I then need to upload those to another system using a webservice designed by an external source.  This web service will only accept upto to x amount of records.
    The process:
    for each object in the Jca Response
          Insert object into Service callout Request body
          if object index = number of objects in jca response or object index = next batch index
               Invoke service callout
               Append service callout Response to a total response object (xquery transform)
               increase next batch index by Batch size
               reset service callout to empty body
           endif
    end for
    replace body  with total response object.
    If I use the data set that only has 5 records  and use a batch size of 2 the process works fine.
    If I use  a data set with 89 records  and a batch size of 2 I get the below out of memory error  after about 10 service callouts
    the quantity of data in the objects is pretty small, less than 1kB for each JCA Object
    Server Name:
    AdminServer
    Log Name:
    ServerLog
    Message:
    Failed to process response message for service ProxyService Sa/Proxy Services/DataSync:
    java.lang.OutOfMemoryError: allocLargeObjectOrArray:
    [C, size 67108880 java.lang.OutOfMemoryError: allocLargeObjectOrArray:
    [C, size 67108880 at org.apache.xmlbeans.impl.store.Saver$TextSaver.resize(Saver.java:1700)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.preEmit(Saver.java:1303) at
    org.apache.xmlbeans.impl.store.Saver$TextSaver.emit(Saver.java:1234)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emitXmlns(Saver.java:1003)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emitNamespacesHelper(Saver.java:1021)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emitElement(Saver.java:972)
    at org.apache.xmlbeans.impl.store.Saver.processElement(Saver.java:476)
    at org.apache.xmlbeans.impl.store.Saver.process(Saver.java:307)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.saveToString(Saver.java:1864)
    at org.apache.xmlbeans.impl.store.Cursor._xmlText(Cursor.java:546)
    at org.apache.xmlbeans.impl.store.Cursor.xmlText(Cursor.java:2436)
    at org.apache.xmlbeans.impl.values.XmlObjectBase.xmlText(XmlObjectBase.java:1500)
    at com.bea.wli.sb.test.service.ServiceTracer.getXmlData(ServiceTracer.java:968)
    at com.bea.wli.sb.test.service.ServiceTracer.addDataType(ServiceTracer.java:944)
    at com.bea.wli.sb.test.service.ServiceTracer.addDataType(ServiceTracer.java:924)
    at com.bea.wli.sb.test.service.ServiceTracer.addContextChanges(ServiceTracer.java:814)
    at com.bea.wli.sb.test.service.ServiceTracer.traceExit(ServiceTracer.java:398)
    at com.bea.wli.sb.pipeline.debug.DebuggerTracingStep.traceExit(DebuggerTracingStep.java:156)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.exitComponent(PipelineContextImpl.java:1292)
    at com.bea.wli.sb.pipeline.MessageProcessor.finishProcessing(MessageProcessor.java:371)
    at com.bea.wli.sb.pipeline.RouterCallback.onReceiveResponse(RouterCallback.java:108)
    at com.bea.wli.sb.pipeline.RouterCallback.run(RouterCallback.java:183)
    at weblogic.work.ContextWrap.run(ContextWrap.java:41)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Subsystem:
    OSB Kernel
    Message ID:
    BEA-382005
    It appears to be the service callout that is the problem (it calls another OSB service that logins and performs the data upload to the External service)  because If I change the batch size up to 100  the loop will load all the 89 records into the callout request and execute it fine.  If I have a small batch size then I run out of memory.
    Is there some settings I need to change?  Is there a better way in OSB (less memory intensive than service callout in a for loop)?
    Thanks.

    hi,
    Could you please let me know if you get rid off this issue as we are also facing the same issue.
    Thanks,
    SV

  • Importing Word docs from a RH for Word project

    I have a HUGE RH for Word project that I'm trying to convert
    to RHTML (RH Office X5). We generate CHM with this project, and
    we've got map ids for all topics. I've been to Peter Grainge's site
    to get some ideas, but I don't think they're going to work. There
    are so many Word files and topics (537 and 2,974, respectively)
    that the more I think about it, the more I think that a conversion
    to RH HTML might not be worth it.
    When I tried to import all of the Word documents and also
    convert the TOC (converting the Index isn't an option since it
    never worked with our large number of Word docs) and use the
    HTMLHelp.css (using the Import wizard), RH HTML crashed twice after
    40 minutes.
    So, I created a new RH HTML project and tried to import just
    one Word doc from the RH for Word project, and selected the same
    wizard options. As I expected, the Word doc imported, but even
    though I told RH to split the topics on Heading 2, it also copied
    in the characters (#S+@) that preceded every topic heading and
    incorporated them into the Topic Title. AND, RH HTML did not
    "convert" the TOC - it was blank.
    In another post I saw a reference to this patch -
    http://www.adobe.com/support/security/bulletins/apsb07-10.html.
    I'm not sure it's related, although when I examined my second
    failed import attempt, the imported topics were visible in the
    project folder only by using Windows Explorer - RoboHelp HTML did
    not display them from within RoboHelp.
    Does anyone know if this is the patch that will fix this
    issue as well?
    By the way, based on the number of questions I've seen posted
    about RH for Word 7 with zero replies, I'm thinking I'm going to
    run into issues as well, even if we leave it in RH for Word when we
    upgrade to version 7. It seems that its size is an issue for RH
    HTML.
    Thanks,
    Jim
    Thanks,
    Jim

    Hi Jim,
    just as an encouragement: we sucessfully converted a HUGE RH
    for Word project (4,300 topics) to RH HTML a while ago, including
    TOC, index and everything. I must admit though that we had all
    those topics in only 25 word documents. Maybe you can reduce the
    number of documents by moving the topics? There will always be
    problems you run into and afterward, we had to go through every
    single topic and check the formatting, but I guess you'd always
    have to do this. But I think it's worth it, working in HTML is so
    much more convenient.
    Good luck!
    Kathrin

  • Can anyone tell me why I am unable to download a template word doc from webmail onto my mac without it opening in text format? I just need the original document format.

    Can anyone tell me why I am unable to download a template word doc from webmail onto my mac without it opening in text format? I just need the original document format.

    Where to begin... and why would you ask here? (workstation owners)
    Places I can think to try, after google of course....
    Forum devoted to something like Word / Mactopia or Pages.... whether you are using Office 2011, and no idea what browser or webmail (IMAP, Gmail, other)
    And then there really are notebook with subforum for MacBook Pro
    Apple Site Map
    Apple Support Mail
    Apple Support

  • CPU Usage - Generating Word Docs from RoboHelp X5

    If you have generated a fair-sized document through RoboHelp,
    and you are having problems with your CPU usage pegging out around
    100%, bouncing up and down between 50% and 100%, the page
    repainting as you scroll through the document, etc., this solution
    is for you!
    I am using RoboHelp X5 to generate large Word documents
    (2003). This solution worked perfect for me. The problem is with
    document corruption, apparently. After you have generated your Word
    document and opened the document, be sure to display the paragraph
    marks. You will probably see the “]” mark at or near
    the end of the document. Select your entire document,
    except for the final paragraph mark, making sure to exclude
    this symbol, and copy everything else. Open a blank Word document
    and paste this content into the new document.
    You will now need to reattach your template (.dot) file for
    the generated document through Tools/Templates and Addins:
    1. Locate the applicable document template and attach it
    (it's typically in the base generated project directory in RoboHelp
    - .dot file). Click the OK button to save.
    2. Return to Tools/Templates and Addins. Click the Organizer
    button to display the Styles tab.
    3. In the right-hand list (In Normal.dot), Close the
    Normal.dot file
    4. Open the same RoboHelp .dot template as you selected
    previously.
    4. Select all of the styles once they display in the right
    pane and click the <<Copy button to copy them all over to the
    document template. Confirm that you want to replace all styles in
    the document.
    5. Close the menu using the Close button. The dialog closes
    and your styles should all be updated, if your styles were set up
    appropriately via template and style sheet settings.
    You may need to also adjust the Page Setup page width
    settings, if necessary.
    Good luck!
    Liz0259

    Peter:
    Thank you for responding to me, as I may not have been clear
    enough, and I apologize for that. I was trying to keep it short and
    sweet. This problem started when I began using RoboHelp X5 this
    year.
    To clarify...
    - I'm not concerned with CPU usage during document
    generation, that is to be expected. The document will need to be
    generated originally from a RoboHelp WebHelp project. This does not
    change. The problem takes place AFTER you generate a large document
    and then open it in MS Word.
    - My documents are large, 140-500 pages. It took forever to
    scroll through the Word document (RoboHelp-generated), the screen
    kept repainting, and the CPU usage stuck fluctuating frequently
    between 50% and 100%, not allowing me to do much else. Editing
    those documents was a nightmare. Even if I shut down all other
    programs.
    - Something translates to the Word doc from RoboHelp that
    maxes out the CPU usage, and I can't locate the exact culprit.
    However, it appears to be tied to the faded "]" symbol at the end
    of the document (there is a "[" at the beginning, too). So you have
    to omit more than the last paragraph mark; that symbol also needs
    to be left out.
    - The "corruption" information came from Microsoft; it could
    be something other than that, but this is what they said. I found
    nothing that would help on the RoboHelp forum, so I went to
    Microsoft to see if they had a solution. Apparently, this is a
    common problem with Word 2003, but the articles didn't mention
    RoboHelp in the issues. I tried this solution, adding the omission
    of the "[" symbol, with complete success.
    - When you copy the document without the last paragraph mark,
    it will still include the headers/footers when you paste it
    (although you may need to adjust them slightly). This is not the
    problem.
    - When a document is generated, you can select to use a MS
    Word template, which I do. I fully use the style sheets in
    RoboHelp, and they match my Word styles (template) to keep things
    in sync. Actually, this Word template remains in the project; it is
    not moved to the folder that holds your Normal.dot file. So the
    link to the template in RoboHelp from your document does in fact
    remain intact. However, you can copy that template to another
    folder outside the project and link it from there, but it won't
    matter.
    - The Word template (.dot) needs to be reapplied in order to
    restore your styles, as the Normal.dot styles are applied when you
    copy the content over to a new document. It doesn't matter where
    you store the template. I reapply this SAME template after I copy
    and paste the content into the new document. This is not the cause
    of the problem. Note: The application of a template is not the same
    thing as going back to the master copy. This is still a fresh
    document, with the content pasted in and the same template applied.
    - I have tried deleting the local copy and starting over. I
    have moved the file to another location. I have renamed or created
    a 'save-as' copy of the file. I tried editing out any extra
    un-necessary merge-tags in Word, looked for macros, etc. All of
    these things do not resolve the CPU Usage problem.
    I hope this makes more sense. You can try it out if you wish,
    but you will need to do this with a large document and use the
    Print View when looking at the document in Word. You'll have less
    of a problem in Normal View, or with a smaller document (under 50
    pages).
    Good luck!
    Liz0259

  • How to upload a Word doc from MacBook to iCloud?

    How to upload a Word doc from MacBook to iCloud?

    Just going to throw in again: iCloud is to keep's Apple's products on Apple's devices synced up between multiple devices. It isn't for sharing. It isn't for storage.
    iCloud is the Apple-branded cloud (see the "i"). It isn't meant to be a completely free-of-charge realization of the future that all the tech people keep calling "the cloud."
    It adds a lot of very nice functionality to Apple's own products, yet people are screaming their heads off about not getting free disk space and free bandwidth to use for whatever they want online. Apple added functionality, but tons of people seem to think they took away functionality. These things were never promised with iCloud.

  • Transferring word docs from vintage mac

    Does anyone know how to transfer word docs from my old Mac plus (1985) to a modern Mac or other PC? Would a personal modem work such as was designed for the original machine?

    ccconti,
    The personal modem will work but my first modem on my first Mac Plus was 300 baud. That option would be painfully slow. Five years ago I met someone who was still using a Plus and modem to email to Germany from the USA. I wanted to document her software configuration but did not get back to it. I would go with standard methods.
    Hopefully you acquired an external SCSI drive some where along the way. It will move files to a newer machine with ethernet. Ethernet will allow you go to the latest computers quickly. Another alternative is zip disks. The real key is finding someone with spare hardware. If you are willing to buy some used equipment, you can do it yourself.
    Do you have access to a school or club that has old equipment? Post back with a list of computers/hard drives you have access to.
    Jim

  • Word docs from pc to iPad

    I can't figure out how to share a word doc from my pc to the iPad. I went through the steps in the manual but can't find the file share option they talk about in the app tab on iTunes. Any ideas?

    Do you have Pages installed on your iPad? If not, I'm not sure that file transfer option will appear, though I'm not certain; perhaps someone else here can confirm or refute. If that is indeed the case, then you'll have to email the document to an account your iPad can pick up, or get Pages or one of the other iPad apps that supports Word docs and provides a file transfer capability.
    Regards.

  • How to open word doc. from forms 10g

    hi all
    i am trying to open word doc. from forms 10g using ole2.
    but it is not working.
    basiccaly this command is not working
    app := CLIENT_OLE2.CREATE_OBJ('Word.Application');
    can anybody help
    thanx

    I found this searching this forum and it works..however, my issue is to open up Microsoft Word passing in data from a query.
    I am working on Forms 10g
    DECLARE AppID PLS_INTEGER;
    BEGIN
    AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\OFFICE11\winword.exe C:\test.doc',
    DDE.APP_MODE_NORMAL);
    END;

  • Unable to convert Microsoft Word doc. to PDF in Words (there is no response)

    Unable to convert Microsoft Word doc to PDF in Words (Does not respond) or Create PDF from a Word doc. in Adobe Acrobat X Standard 10.1.1 with all updates installed. I receive apop-up saying "Missing PDF Maker Files: Dou you want to run the installer in Repair Mode"  I have done this several times. I have un-installrd and re installed the program twice. Still does not work. I'm running Windows 7 Home version and Microsoft Office XP 2002. This is a brabd new Acrobat program right out of the box. Suggestions Please.

    In WORD 2002, I believe you can only print to the Adobe PDF printer. I think that WORD 2003 is the first compatible with AA X. Check out http://kb2.adobe.com/cps/333/333504.html.

  • Out of memory error - from parsing a "fixed width file"

    This may be fairly simple for someone out there but I am trying to write a simple program that can go through a "fixed width" flat txt file and parse it to be comma dilmeted.
    I use a xml file with data dictionary specifications to do the work. I do this because there are over 430 fields that need to be parsed from a fixed width with close to 250,000 lines I can read the xml file fine to get the width dimensions but when I try to apply the parsing instructions, I get an out of memory error.
    I am hoping it is an error with code and not the large files. If it is the latter, does anyone out there know some techniques for getting at this data?
    Here is the code
       import java.io.*;
       import org.w3c.dom.Document;
       import org.w3c.dom.*;
       import javax.xml.parsers.DocumentBuilderFactory;
       import javax.xml.parsers.DocumentBuilder;
       import org.xml.sax.SAXException;
       import org.xml.sax.SAXParseException;
        public class FixedWidthConverter{
          String[] fieldNameArray;
          String[] fieldTypeArray;
          String[] fieldSizeArray;      
           public static void main(String args []){
             FixedWidthConverter fwc = new FixedWidthConverter();
             fwc.go();
             fwc.loadFixedWidthFile();
            //System.exit (0);
          }//end of main
           public void go(){
             try {
                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                Document doc = docBuilder.parse (new File("files/dic.xml"));
                // normalize text representation            doc.getDocumentElement ().normalize ();
                System.out.println ("Root element of the doc is " +
                     doc.getDocumentElement().getNodeName());
                NodeList listOfFields = doc.getElementsByTagName("FIELD");
                int totalFields = listOfFields.getLength();
                System.out.println("Total no of fields : " + totalFields);
                String[] fldNameArray = new String[totalFields];
                String[] fldTypeArray = new String[totalFields];
                String[] fldSizeArray = new String[totalFields];
                for(int s=0; s<listOfFields.getLength() ; s++){
                   Node firstFieldNode = listOfFields.item(s);
                   if(firstFieldNode.getNodeType() == Node.ELEMENT_NODE){
                      Element firstFieldElement = (Element)firstFieldNode;
                      NodeList firstFieldNMList = firstFieldElement.getElementsByTagName("FIELD_NM");
                      Element firstFieldNMElement = (Element)firstFieldNMList.item(0);
                      NodeList textFNList = firstFieldNMElement.getChildNodes();
                      //System.out.println("Field Name : " +
                               //((Node)textFNList.item(0)).getNodeValue().trim());
                      //loads values into an array
                      //fldNameArray[s] = ((Node)textFNList.item(0)).getNodeValue().trim();
                      NodeList typeList = firstFieldElement.getElementsByTagName("TYPE");
                      Element typeElement = (Element)typeList.item(0);
                      NodeList textTypList = typeElement.getChildNodes();
                      //System.out.println("Field Type : " +
                               //((Node)textTypList.item(0)).getNodeValue().trim());
                      //loads values into an array
                      //fldTypeArray[s] = ((Node)textTypList.item(0)).getNodeValue().trim(); 
                      NodeList sizeList = firstFieldElement.getElementsByTagName("SIZE");
                      Element sizeElement = (Element)sizeList.item(0);
                      NodeList textSizeList = sizeElement.getChildNodes();
                      //System.out.println("Field Size : " +
                               //((Node)textSizeList.item(0)).getNodeValue().trim());
                      //loads values into an array
                      fldSizeArray[s] = ((Node)textSizeList.item(0)).getNodeValue().trim();   
                   }//end of if clause
                }//end of for loop with s var
                //setFldNameArray(fldNameArray);
                //setFldTypeArray(fldTypeArray);
                setFldSizeArray(fldSizeArray);
                 catch (SAXParseException err) {
                   System.out.println ("** Parsing error" + ", line "
                      + err.getLineNumber () + ", uri " + err.getSystemId ());
                   System.out.println(" " + err.getMessage ());
                 catch (SAXException e) {
                   Exception x = e.getException ();
                   ((x == null) ? e : x).printStackTrace ();
                 catch (Throwable t) {
                   t.printStackTrace ();
          }//end go();
           public void setFldNameArray(String[] s){
             fieldNameArray = s;
          }//end setFldNameArray
           public void setFldTypeArray(String[] s){
             fieldTypeArray = s;
          }//end setFldTypeArray
           public void setFldSizeArray(String[] s){
             fieldSizeArray = s;
          }//end setFldSizeArray
           public String[] getFldNameArray(){
             return fieldNameArray;
          }//end setFldNameArray
           public String[] getFldTypeArray(){
             return fieldTypeArray;
          }//end setFldTypeArray
           public String[] getFldSizeArray(){
             return fieldSizeArray;
          }//end setFldSizeArray 
           public int getNumLines(){
             int countLines = 0;
             try {
                    //File must be in same director and be the name of the string below
                BufferedReader in = new BufferedReader(new FileReader("files/FLAT.txt"));
                String str;
                while ((str = in.readLine()) != null) {
                   countLines++;
                in.close();
                 catch (IOException e) {}    
             return countLines;
          }//end of getNumLines
           public void loadFixedWidthFile(){
             int c = getNumLines();
             int i = 0;
             String[] lineProcessed = new String[c];
             String chars;
             try {
                    //File must be in same director and be the name of the string below
                BufferedReader in = new BufferedReader(new FileReader("files/FLAT.txt"));
                String str;
                while ((str = in.readLine()) != null) {
                   //System.out.println(str.length());
                   lineProcessed[i] = parseThatLine(str);
                   i++;
                in.close();
                 catch (IOException e) {}     
                //write out the lineProcess[] array to another file
             writeThatFile(lineProcessed);
          }//end loadFixedWidthFile()
           public void writeThatFile(String[] s){
             try {
                BufferedWriter out = new BufferedWriter(new FileWriter("files/outfilename.txt"));
                for(int i = 0; i < s.length -1; i++){
                   out.write(s);
    }//end for loop
    out.close();
    catch (IOException e) {}
    }//end writeThatFile
    public String parseThatLine(String s){
    int start = 0;
    int end = 0;
    String parsedLine = "";
    int numChars = getFldSizeArray().length;
    //Print number of lines for testing
    //System.out.println(numChars);
    String[] oArray = getFldSizeArray();
    //String chars = oArray[0];
    //System.out.println(chars.length());
    //oArray
    for(int i = 0; i < numChars -1; i++ ){
    if(i == 0){
    start = 0;
    end = end + Integer.parseInt(oArray[i])-1;
    else
    start = end;
    end = end + Integer.parseInt(oArray[i]);
    parsedLine = parsedLine + s.substring(start, end) + "~";
    }//end for loop
    return parsedLine;
    }//End of parseThatLine
    I have tried to illeminate as many arrays as I can thinking that was chewing up the memory but to no avail.
    Any thoughts or ideas?
    Message was edited by:
    SaipanMan2005

    You should not keep a String array of all the lines of the file read.
    Instead for each line read, parse it, then write the parsed line in the other file:      public void loadFixedWidthFile() {
             BufferedReader in = null;
             BufferedWriter out = null;
             try {
                //File must be in same director and be the name of the string below
                in = new BufferedReader(new FileReader("files/FLAT.txt"));
                out = new BufferedWriter(new FileWriter("files/outfilename.txt"));
                String str;
                while ((str = in.readLine()) != null) {
                   //System.out.println(str.length());
                   str = parseThatLine(str);
                   //write out the parsed str to another file
                   out.write(str);
             catch (IOException e) {
                e.printStackTrace(); // At least print the exception - never swallow an exception
             finally { // Use a finally block to be sure of closing the files even when exception occurs
                try { in.close(); }
                catch (Exception e) {}
                try { out.close(); }
                catch (Exception e) {}
          }//end loadFixedWidthFile()Regards

  • RoboHelp 9 gives an out of memory error and crashes when I try to import or link a Frame 10 file or

    I have Tech Suite 3. If I start a new RoboHelp project and try to import or link Frame files, RoboHelp tries for a while, then I get an Out of Memory error and the program crashes.
    I opened one of the sample projects and was able to link to one of my frame files without any problem, so it seems to be an issue with creating something new.
    Any suggestions?

    It happens when I create a new project and then try to import or link frame docs to make up the content. It starts scanning, then crashes. I did get it to the conversion setting page once, but no further.
    It does not happen if I open one of the supplied example projects and link a file. But then it doesn't let me choose, during import, any style mapping. And I can't delete the sample project fold
    Twice now it has told me when I tried to import (not link, but import) that my .fm file could not be opened, and told me to verify that Frame is installed (it is) and that the file is a valid frame file (it is).
    The docs and project are in separate folders on my C: drive.

  • Out of memory error importing a JPA Entity in WebDynpro Project

    Hi All!
    We are having problems importing JPA entities in a WebDynPro project, this is our escenario.
    We have two entities, entity A that has a ManyToOne relationship with entity B and at the same time entity B has a OneToMany relationship with entity A. When in the controller context we try to create a node usign a model binding to Entity A we got an Out of memory error from NetWeaver DS. Trying to figure out the problem we identified that in the model that we imported we got the following.
    Entity A
        Entity B
            Entity A
               Entity B
                  and so on....... without and end
    What are we doing wrong? Or how can we avoid these behavior?
    Regards,

    Hi Kaylan:
    Thanks for your reply. You are rigth about the error that we are getting. This is our scenario.
    We have a ejb that in some of his method uses the entity Lote, and this entity has a relationship with entity Categoria. When we import the EJB using the model importer netweaver imports the EJB methods and the entities that they use.
    So after doing this besides the ejb's methods we got these two entities that are the ones that are generating the error, when we try to create a context node using the Categoria entity.
    @Entity
    @Table(name="TB_LOTE")
    public class Lote implements Serializable {
         @EmbeddedId
         private Lote.PK pk;
         @ManyToOne
         @JoinColumn(name="CO_CATEGORIALOTE")
         private Categoria coCategorialote;
         @Embeddable
         public static class PK implements Serializable {
              @Column(name="CO_LOTE")
              private String coLote;
              @Column(name="CO_ORDENFABRICACION")
              private String coOrdenfabricacion2;
                   ^ this.coOrdenfabricacion2.hashCode();
    @Entity
    @Table(name="TB_CATEGORIA")
    public class Categoria implements Serializable {
         @Id
         @Column(name="CO_CATEGORIA")
         private String coCategoria;
         @OneToMany(mappedBy="coCategorialote")
         private Set<Lote> tbLoteCollection;
    Regards,
    Jose Arango

  • Import Manager Out of Memory error

    I am running MDM 5.5.24.06 server on Windows XP Professional. The server has 4.0 GB RAM with 1.5 GB Virtual memory.
    I am trying to load 129 material master records from R/3 4.6 ( XML file size 8 MB), into MDM using Import Manager.
    When I click on import icon (Import Status tab selected), MDM Import Manager rightway returns 'Out of Memory' error.
    Tried to import the file again after rebooting the machine, restarting MDM Server, but still it returned the same error.
    Has anybody tried loading the R/3 material data into MDM? What's the experience? What was the load (# of records)?
    What was MDM IM performance? What's your hardware/software config?
    Appreciate your help.
    Thanks,
    Abhay

    Hi Abhay,
    My workstation has Windows 2000, Pentium 4 CPU 3.2 Ghz, 515,555 KB RAM.  The recommended specifications can be found on service market place of SAP, and we used those to procure our workstations.
    MDM server must be more pwerful than a workstation.  Try running the import manager from the server machine itself.  If it works there but not on your machine, it is memory of your workstation.
    Sometimes, I think this error comes when import map some issues- fields not mapped accurately or remote key mapped wrong etc.
    It is probably judicious to rpove the system memory as first step.
    Good luck!

Maybe you are looking for