When parsing a large size xml file , OutOfMemorry exception(attach code)

Dear all ,
I met a OutOfMemorry exception when I parse a xml file (20M) in my application(I extract data in xml file for building my application data), but I found that it take long time(for 2 more minutes) even just searching the xml file , because my application is viewed by web page , so it's too bad for waiting.
what I used is org.jdom.input.SAXBuilder(jdom1.0beta8-dev) , and my xml file structure is like :
<errors>
<item1>content</item1>
<item2>content</item2>
</errors>
and this is my source code of parsing xml file :
import java.io.*;
import java.text.*;
import java.util.*;
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;
public class XMLProperties {
    private File file;
    private Document doc;
    private Map propertyCache = new HashMap();
    public XMLProperties(String filename) {
            SAXBuilder builder = new SAXBuilder();
            // Strip formatting
            DataUnformatFilter format = new DataUnformatFilter();
            builder.setXMLFilter(format);
            long time_start = System.currentTimeMillis();
            Runtime run = Runtime.getRuntime();
            doc = builder.build(new File(filename));
            System.out.println("Build doc memory ="+(run.totalMemory()-
                     run.freeMemory())/1024+"K");
            System.out.println("Build doc used time :"+(
                     System.currentTimeMillis()-time_start)/1000+" s");
        catch (Exception e) {
            System.err.println("Error creating XML parser in "
                + "PropertyManager.java");
            e.printStackTrace();
     public String [] getChildrenProperties(String parent) {
        // Search for this property by traversing down the XML heirarchy.
        Element element = doc.getRootElement();
        element = element.getChild(parent);
        if (element == null) {
            // This node doesn't match this part of the property name which
            // indicates this property doesn't exist so return empty array.
            return new String [] { };
        // We found matching property, return names of children.
        List children = element.getChildren();
        int childCount = children.size();
        String [] childrenNames = new String[childCount];
        for (int i=0; i<childCount; i++) {
            childrenNames[i] = ((Element)children.get(i)).getName();
        return childrenNames;
    }the test main class:
import java.util.Map;
import java.util.HashMap;
import org.jdom.*;
import org.jdom.input.*;
public class MyTest {
  public static void main(String[] args) {
    long time_start = System.currentTimeMillis();
    Runtime run = Runtime.getRuntime();
    Map childs = new HashMap();
    System.out.println("Used memory before="+(run.totalMemory()-run.freeMemory())/1024 + "K");
    XMLProperties parser = new XMLProperties("D:\\projects\\edr\\jsp\\status-data\\edr-status-2003-09-01.xml");
    String[] child = parser.getChildrenProperties("errors");
    for(int i=0;i<child.length;i++) {
//      childs.put(new Integer(i), child);
if(i%1000 == 0) {
System.out.println("Used memory while="+(run.totalMemory()-run.freeMemory()/1024+"K"));
System.out.println("child.length="+child.length);
System.out.println("Used memory after="+(run.totalMemory()-run.freeMemory())/1024+"K");
System.out.println("Time used: "+(System.currentTimeMillis()-time_start)/1000+"s");
The result is : Used memory before=139K
Used memory while=56963K
Used memory after=51442K
child.length=27343
Time used: 146s
is that some way to solve this problem ?
Thanks for your help

I met a OutOfMemorry exception when I parse a xml
l file (20M) in my application(I extract data in xml
file for building my application data)...Rule of thumb for parsing XML: the memory you need is about 10 times the size of the XML file. So in your case you need 200 MB of free memory.
, but I found
that it take long time(for 2 more minutes) even just
searching the xml file , because my application is
viewed by web page...Then you need to redesign your application. Parsing 20 megabytes of XML for every request is -- as you can see -- impractical. Sorry I can't suggest how, since I have no idea what your application is.

Similar Messages

  • How do you make Xerces parser generate doctype to XML-file?

    When I use javacode (with xerces parser) to update an XML-file the doctype-line disappears!!!!
    Anyone how knows how to solve this problem????
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE test SYSTEM "StatisticStandard.dtd"> <---- This is the line I want to keep!!!
    <test>
    <totalanswered>5</totalanswered>
    <set>
    <alt>1</alt>
    </set>
    </test>

    Hi!
    I found a sort of solution to my problem. I don't think it is the best, but it works!
    Where you write to file you add this line (look for the arrow).
    (I use the javax.xml.transform package)
    Source xmlSource = new DOMSource(document);
    Result result = new StreamResult(
    new FileOutputStream(path+file));
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Transformer transformer = transformerFactory.newTransformer();
    transformer.setOutputProperty(javax.xml.transform.OutputKeys.DOCTYPE_SYSTEM, "dtdfilename.dtd"); <-- This one does the trick!!!
    transformer.transform(xmlSource, result);
    Anette :)

  • Parser dimension ACCOUNT's xml file error.

    Hi friends,
    i manully uploading master data in ACCOUNT dimension.
    what i did here, i manually added PARENTH1hierarchy and i changed that column position infront of "ACCTYPE" property. While pasting i might paste on ACCTYPE property & processed ACCOUNT dim.So it gone and disturbed underlying XML file. I checked 3 files XLS,XLT and XML files in UJFS. But XLS & XLT doesn't have ACCTYPE property. So how can i put it back? Any suggestions pls.
    Eventhough ACCTYPE dim property defined and existed(under maintain dim property of ACCOUNT dim). when i try to check maintain members data for manually entering data, it not available in columns. when i try to process ACCOUT dim, system saying below error message. 
    Parser dimension ACCOUNT's xml file error.
    How to correct this error.?
    Thanks,
    Naresh
    Edited by: Naresh P on Jan 13, 2011 7:20 AM

    Hi,
    It will be better to delete the XML file from UJFS and process your dimension once again. However, it might happen that you are still unable to edit the membersheet. In that case, it will be advisable to take a backup of the member sheet and recreate the same member sheet once again.
    Hope this helps.

  • Read a large size text file

    how can i read a large size text file in multiple parts without lossin any data ?
    Ben

    Why are you afraid of losing data? There's no reason that you would lose data if you are reading a large text file.
    You should use the various Reader and Writer classes in package java.io to read and write text files. Here's an example of how you can read a text file line by line:
    BufferedReader r = new BufferedReader(new FileReader("myfile.txt));
    int lineno = 1;
    String line;
    while ((line = r.readLine()) != null) {
      System.out.printf("%d: %s%n", i, line);
      i++;
    r.close();

  • HO w to use SAX parser to create an XML file on the fly

    Hi All,
    Currently I am using the DOM parser to create an XML file from a text file. But as the DOM takes much memory and inefficient, I need to convert the DOM translator to SAX translator. Can I do that ?? If YES then how to go about that and if NO then what may be the workaround for that.
    Please help me out
    Thanx in advance
    kaushik

    Incidentally, look at this thread:
    http://forum.java.sun.com/thread.jsp?forum=34&thread=252415
    It has an example of how to transform an XML file via XSLT. If you change this to use the zero-argument form of newTransformer, it will apply the "identity transformation" to your input, thus outputting your XML in valid form. Now you just need to figure out how to provide SAX input to this, and the JAXP download includes an example of that.

  • XML file with an attached MIME encoded ZIP file

    Hi all,
    I'm new to SAP WAS and MIME encoding/decoding, and I'm trying to generate an XML file with an attachment which is also MIME encoded.
    1) I have dummy files (1.jpg, 2.jpg) and I'm trying to zip these files into one zip file (files.zip).
    2) I'm trying to MIME encode/decode this zip file.
    3) I'm trying to attach this MIME encoded zip file to existing XML file.
    Which FMs could I use to accomplish this?  Your help is very appreciated.
    Thank you.
    below is a file example that I'm trying to generate.
    MIME-Version: 1.0
    Content-Type: multipart/mixed;
         boundary="--XXXXboundary text"
    Content-Transfer-Encoding: 7bit
    This is a multi-part message in MIME format.
    --XXXXboundary text
    Content-Type: text/xml;
         charset="utf-8"
    Content-Transfer-Encoding: 8bit
    <?xml version="1.0" encoding="utf-8"?>
    <abc/>
    <def/>
    --XXXXboundary text
    Content-Type: application/octet-stream;       name="files.zip"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment
    UEsDBBQAAAAIAI9EejAs5k34H84DAAYgBAAMAAAAMDAyMjQ5MTEucGRmnLsJWBNJ2zb6jmJIIIFE
    BAMIJGEVBSKGRRAhEGQNoGwKYoiAEnYRUFGIkBAQFzYXRNHAAEGQZRy2ATFDUAHfGScSIUwQMMrM
    ECGADptA0n/jzLtc//dd51znVAKdru6uqn7q6fu5764qQz

    Just create an applet (extend JApplet)... add a JTextArea to it....fill the text area with the text from an XML doc.
    To get the text of the XML doc just do something like..
    File xmlFile = new File("<path to xml file>");
    FileInputStream fis = new FileInputStream(xmlFile);
    byte[] bytes = new byte[(int) xmlFile.length()];
    fis.read(bytes);
    fis.close();
    String xmlText = new String(xmlBytes);
    textArea.setText(xmlText);
    ...try something like that (assuming..i understand what it is u want)

  • I want to load large raw XML file in firefox and parse by DOM. But, for large XML file the firefox very slow some time crashed . Is there any option to increase DOM handling memory in Firefox

    Actually i am using an off-line form to load very large XML file and using firefox to load that form. But, its taking more time to load and some time the browser crashed. through DOM parsing this XML file to my form. Is there any option to increase DOM handler size in firefox

    Thank you for your suggestion. I have a question,
    though. If I use a relational database and try to
    access it for EACH and EVERY click the user makes,
    wouldn't that take much time to populate the page with
    data?
    Isn't XML store more efficient here? Please reply me.You have the choice of reading a small number of records (10 children per element?) from a database, or parsing multiple megabytes. Reading 10 records from a database should take maybe 100 milliseconds (1/10 of a second). I have written a web application that reads several hundred records and returns them with acceptable response time, and I am no expert. To parse an XML file of many megabytes... you have already tried this, so you know how long it takes, right? If you haven't tried it then you should. It's possible to waste a lot of time considering alternatives -- the term is "analysis paralysis". Speculating on how fast something might be doesn't get you very far.

  • JDOM parser fails to parse Huge Size Xml Files ??? Unable to Parse ???

    Hi All,
    When i transformed or parsed many XML Files of huge size...I am getting java.lang.OutOfMemory error for all the huge xml files. It is working fine for files which is of small size.
    I've 2GB ram in my system. I have also set heapsize for the JVM.
    -Xms512M -Xmx1800M (or) -Xms512M -Xmx1500M
    I like to know what are the drawbacks of JDOM parser ?
    What is the maximum size of the Xml which JDOM can parse ?
    I've read a long time before that parsers have certain limitations. Can anybody tell me the limitations of the parses?
    Please help. i'm currently using jdom.jar to parse the xml files.
    Thanks,
    J.Kathir

    Hi All,
    When i transformed or parsed many XML Files of huge
    size...I am getting java.lang.OutOfMemory error for
    all the huge xml files. It is working fine for files
    which is of small size.Of course it is.
    >
    I've 2GB ram in my system. I have also set heapsize for the JVM.
    -Xms512M -Xmx1800M (or) -Xms512M -Xmx1500MYou can't always get what you want. Your JVM is competing with all the other processes on your machine, including the OS, for RAM.
    I like to know what are the drawbacks of JDOM parser ?You just discovered it: all DOM parsers create an in-memory representation of the entire document. A SAX parser does not.
    What is the maximum size of the Xml which JDOM can parse ?The max amount of memory that you have available to you.
    I've read a long time before that parsers have
    certain limitations. Can anybody tell me the
    limitations of the parses?See above.
    Please help. i'm currently using jdom.jar to parse the xml files.You can try a SAX parser or a streaming parser. Maybe those can help.
    %

  • How to validate and transform large (180M) xml files

    Hi:
    I've been looking at various ways to do this with oracle and am getting a bit lost in the sea of documentation and different ways to go about this. I was hoping that something like the XMLParser class and XMLTransform would be smart enough to handle large files by using SAX when it has to but I'm getting "too many nodes" when trying to transform a really large file. I've gotten oraxsl to handle it if I pass in the proper memory parameters on the command line but a) this will still have limits and b) I was trying to do this in a stored procedure which (I think) means I'm looking at XMLParser?
    I've also seen documentation on something called "Scalable DOM" but I think that's only in 11g? So I'm thinking I have to write a (Java?) stored procedure to loop through the top elements of this XML file (select extract(...)) and transform each node?
    I have the XML, XSD, and XSLT all in clob columns. What's the easiest/quickest path within Oracle to validate the XML against the xsd and translate source XML with XSL?
    I'm using Oracle 10gR2 on RH Linux.
    Thanks.

    So I'm thinking I have to write a (Java?) stored procedure to loop through the top elements of this XML file (select extract(...)) and transform each node? Here's something I've written a while back when I hit the same restrictions ("too many nodes") on 10.2.0.4.
    It takes XMLType as input parameters (but it's easy to adapt for CLOB), and streams the transformed XML directly into a file :
    create or replace and compile java source named ora_xslt_util as
    import oracle.xml.parser.v2.*;
    import oracle.xdb.XMLType;
    import java.io.*;
    import org.w3c.dom.*;
    public class oraXSL
    private static XMLDocument getXMLDocument(XMLType xml) throws Exception
        XMLDocument doc = null;
        DOMParser parser  = new DOMParser();
        parser.setValidationMode(oracle.xml.parser.v2.XMLParser.NONVALIDATING);
        parser.setPreserveWhitespace(true);
        parser.parse(new StringReader(xml.getStringVal()));
        doc = parser.getDocument();
        return doc;
    public static void transform(XMLType doc, XMLType xsl, String filename) throws Exception
        OutputStream os = new FileOutputStream(filename);
        XMLDocument xmldoc = getXMLDocument(doc);
        XMLDocument xsldoc = getXMLDocument(xsl);
        XSLProcessor xsp = new XSLProcessor();
        XSLStylesheet xss = xsp.newXSLStylesheet(xsldoc);
        xsp.processXSL(xss, xmldoc, os);
        os.close();
    }and the PL/SQL wrapper (originally part of a package) :
    PROCEDURE processXSL (
       p_xmldoc IN XMLType
    , p_xsldoc IN XMLType
    , p_filename IN VARCHAR2
    IS
    LANGUAGE JAVA NAME 'oraXSL.transform(oracle.xdb.XMLType,oracle.xdb.XMLType,java.lang.String)'
    ;

  • WebDAV Write Unreliability - Large non-XML Files

    I am unable to get Oracle's WebDAV implementation on Windows XP to reliably store large (1 Megabyte +) files that are not XML, without unexplained errors occurring, which result in only part files being transferred.
    For testing I started using the repository folders created by the XDB Basic Demo, using Windows Explorer WebDAV as the client to insert files of varying sizes. Files in excess of 1 megabyte files fail more often than succeed, but I have occasionally succeeded in storing files of many megabytes. Because they were handy I mainly used ZIP files to insert into the Oracle XML DB repository. When the files were renamed to extension, .xml, they always succeeded.
    To eliminate client error, I have also used DavExplorer with the same symptoms observed. No problems were experienced retrieving large files from the Oracle XML DB Repository. My tests were performed using Oracle 9.2.0.5 and 10.1.0.2. The same problem did not occur when using Oracle's FTP interface, and when using the "native" Apache 1.3 and Apache WebDAV implementations.
    This failure is a major problem for our application, which would otherwise fit very well with Oracle XML DB features. Our application provides an authoring environment for a large collection of small XML files, but also has to allow storage of some related GIF, PDF and Microsoft Offices files. Our customers are large corporates, who would prefer to use Oracle for this requirement and for related data processing requirements.
    In case, it is relevant, we are not restricted to running Oracle on XP, with Unix platforms being a more likely option for our customers.
    I could not find details of the error logged by the Oracle software, using either database version. The only information I have gathered about the failure was provided by adding the following line to sqlnet.ora:
    TRACE_LEVEL_SERVER=4
    The trace output for a failure is as follows:
    [19-MAY-2004 13:46:59:735] nsopen: opening transport...
    [19-MAY-2004 13:46:59:735] nsopen: transport is open
    [19-MAY-2004 13:46:59:735] nsopen: global context check-in (to slot 1) complete
    [19-MAY-2004 13:46:59:735] nsanswer: deferring connect attempt; at stage 1064
    [19-MAY-2004 13:46:59:735] nsc2addr: (ADDRESS=(PROTOCOL=tcp)(DEV=340)(HOST=132.223.134.163)(PORT=8080))
    [19-MAY-2004 13:46:59:735] nttgetport: port resolved to 8080
    [19-MAY-2004 13:46:59:735] nttbnd2addr: using host IP address: 132.223.134.163
    [19-MAY-2004 13:46:59:735] nstimarmed: no timer allocated
    [19-MAY-2004 13:46:59:735] nsclose: global context check-out (from slot 1) complete
    [19-MAY-2004 13:46:59:735] nttcnp: Validnode Table IN use; err 0x0
    [19-MAY-2004 13:46:59:735] nsopen: opening transport...
    [19-MAY-2004 13:46:59:735] nttcnp: Validnode Table IN use; err 0x0
    [19-MAY-2004 13:46:59:735] nttcnp: Validnode Table IN use; err 0x0
    [19-MAY-2004 13:46:59:735] nttcnp: getting sockname
    [19-MAY-2004 13:46:59:735] nttcnp: getting peername
    [19-MAY-2004 13:46:59:735] nttcon: set TCP_NODELAY on 296
    [19-MAY-2004 13:46:59:745] nsopen: transport is open
    [19-MAY-2004 13:46:59:745] nsopen: global context check-in (to slot 1) complete
    [19-MAY-2004 13:46:59:745] nstoControlATO: ATO disabled for ctx=0x055D6FC4
    [19-MAY-2004 13:46:59:745] nsevdansw: exit
    [19-MAY-2004 13:46:59:745] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:745] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:745] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:745] nstoControlATO: ATO disabled for ctx=0x055D3548
    [19-MAY-2004 13:46:59:745] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:745] nstoControlATO: ATO disabled for ctx=0x055D3548
    [19-MAY-2004 13:46:59:745] snttcallback: op = 5, bytes = 232, err = 0
    [19-MAY-2004 13:46:59:745] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:745] nstoControlATO: ATO disabled for ctx=0x055D3548
    [19-MAY-2004 13:46:59:755] snttcallback: op = 5, bytes = 296, err = 0
    [19-MAY-2004 13:46:59:755] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:755] nstoControlATO: ATO disabled for ctx=0x055D3548
    [19-MAY-2004 13:46:59:755] snttcallback: op = 5, bytes = 0, err = 0
    [19-MAY-2004 13:46:59:755] ntt2err: Read unexpected EOF ERROR on 296
    [19-MAY-2004 13:46:59:755] snttcallback: op = 5, bytes = 0, err = 0
    [19-MAY-2004 13:46:59:755] ntt2err: Read unexpected EOF ERROR on 296
    [19-MAY-2004 13:46:59:755] snttcallback: op = 5, bytes = 0, err = 0
    [19-MAY-2004 13:46:59:755] ntt2err: Read unexpected EOF ERROR on 296
    [19-MAY-2004 13:46:59:755] snttcallback: op = 5, bytes = 0, err = 0
    [19-MAY-2004 13:46:59:755] ntt2err: Read unexpected EOF ERROR on 296
    [19-MAY-2004 13:46:59:755] nsdo: transport read error
    [19-MAY-2004 13:46:59:755] nserror: nsres: id=1, op=68, ns=12537, ns2=12560; nt[0]=507, nt[1]=0, nt[2]=0; ora[0]=0, ora[1]=0, ora[2]=0
    [19-MAY-2004 13:46:59:755] nstimarmed: no timer allocated
    [19-MAY-2004 13:46:59:765] nsclose: closing transport
    [19-MAY-2004 13:46:59:765] nsclose: global context check-out (from slot 1) complete
    [19-MAY-2004 13:46:59:765] nsopen: opening transport...
    [19-MAY-2004 13:46:59:765] nsopen: transport is open
    [19-MAY-2004 13:46:59:765] nsopen: global context check-in (to slot 1) complete
    [19-MAY-2004 13:46:59:765] nsanswer: deferring connect attempt; at stage 1064
    [19-MAY-2004 13:46:59:765] nsc2addr: (ADDRESS=(PROTOCOL=tcp)(DEV=340)(HOST=132.223.134.163)(PORT=8080))
    [19-MAY-2004 13:46:59:765] nttgetport: port resolved to 8080
    [19-MAY-2004 13:46:59:765] nttbnd2addr: using host IP address: 132.223.134.163
    [19-MAY-2004 13:46:59:765] nstimarmed: no timer allocated
    [19-MAY-2004 13:46:59:765] nsclose: global context check-out (from slot 1) complete
    [19-MAY-2004 13:46:59:765] nttcnp: Validnode Table IN use; err 0x0
    [19-MAY-2004 13:46:59:765] nsopen: opening transport...
    [19-MAY-2004 13:46:59:765] nttcnp: Validnode Table IN use; err 0x0
    [19-MAY-2004 13:46:59:765] nttcnp: Validnode Table IN use; err 0x0
    [19-MAY-2004 13:46:59:765] nttcnp: getting sockname
    [19-MAY-2004 13:46:59:765] nttcnp: getting peername
    [19-MAY-2004 13:46:59:765] nttcon: set TCP_NODELAY on 296
    [19-MAY-2004 13:46:59:765] nsopen: transport is open
    [19-MAY-2004 13:46:59:765] nsopen: global context check-in (to slot 1) complete
    [19-MAY-2004 13:46:59:765] nstoControlATO: ATO disabled for ctx=0x055D6FC4
    [19-MAY-2004 13:46:59:765] nsevdansw: exit
    [19-MAY-2004 13:46:59:765] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:765] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:765] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:765] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:765] nstoControlATO: ATO disabled for ctx=0x055D3548
    [19-MAY-2004 13:46:59:765] snttcallback: op = 5, bytes = 302, err = 0
    [19-MAY-2004 13:46:59:765] ntt2err: soc 296 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:46:59:775] snttcallback: op = 5, bytes = 8192, err = 0
    [19-MAY-2004 13:46:59:775] snttcallback: op = 5, bytes = 8192, err = 0
    [19-MAY-2004 13:46:59:775] snttcallback: op = 5, bytes = 8192, err = 0
    [19-MAY-2004 13:46:59:775] snttcallback: op = 5, bytes = 8192, err = 0
    [19-MAY-2004 13:47:00:246] nstoControlATO: ATO disabled for ctx=0x055D3548
    [19-MAY-2004 13:47:00:246] nstimarmed: no timer allocated
    [19-MAY-2004 13:47:00:246] nsclose: closing transport
    [19-MAY-2004 13:47:00:366] nsclose: global context check-out (from slot 1) complete
    The trace for a successful transfer is as follows:
    [19-MAY-2004 13:57:28:249] nsopen: opening transport...
    [19-MAY-2004 13:57:28:249] nsopen: transport is open
    [19-MAY-2004 13:57:28:249] nsopen: global context check-in (to slot 1) complete
    [19-MAY-2004 13:57:28:249] nsanswer: deferring connect attempt; at stage 1064
    [19-MAY-2004 13:57:28:249] nsc2addr: (ADDRESS=(PROTOCOL=tcp)(DEV=352)(HOST=132.223.134.163)(PORT=8080))
    [19-MAY-2004 13:57:28:249] nttgetport: port resolved to 8080
    [19-MAY-2004 13:57:28:249] nttbnd2addr: using host IP address: 132.223.134.163
    [19-MAY-2004 13:57:28:249] nstimarmed: no timer allocated
    [19-MAY-2004 13:57:28:249] nsclose: global context check-out (from slot 1) complete
    [19-MAY-2004 13:57:28:249] nttcnp: Validnode Table IN use; err 0x0
    [19-MAY-2004 13:57:28:249] nsopen: opening transport...
    [19-MAY-2004 13:57:28:249] nttcnp: Validnode Table IN use; err 0x0
    [19-MAY-2004 13:57:28:249] nttcnp: Validnode Table IN use; err 0x0
    [19-MAY-2004 13:57:28:249] nttcnp: getting sockname
    [19-MAY-2004 13:57:28:249] nttcnp: getting peername
    [19-MAY-2004 13:57:28:249] nttcon: set TCP_NODELAY on 1420
    [19-MAY-2004 13:57:28:249] nsopen: transport is open
    [19-MAY-2004 13:57:28:249] nsopen: global context check-in (to slot 1) complete
    [19-MAY-2004 13:57:28:249] nstoControlATO: ATO disabled for ctx=0x055D6FC4
    [19-MAY-2004 13:57:28:249] nsevdansw: exit
    [19-MAY-2004 13:57:28:249] nstoControlATO: ATO disabled for ctx=0x055D3548
    [19-MAY-2004 13:57:28:249] ntt2err: soc 1420 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:57:28:249] ntt2err: soc 1420 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:57:28:269] ntt2err: soc 1420 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:57:28:269] ntt2err: soc 1420 error - operation=5, ntresnt[0]=524, ntresnt[1]=997, ntresnt[2]=0
    [19-MAY-2004 13:57:28:369] nstoControlATO: ATO disabled for ctx=0x055D3548
    [19-MAY-2004 13:57:31:374] nstimarmed: no timer allocated
    [19-MAY-2004 13:57:31:384] snttcallback: op = 5, bytes = 0, err = 995
    [19-MAY-2004 13:57:31:384] ntt2err: soc 1420 error - operation=5, ntresnt[0]=530, ntresnt[1]=995, ntresnt[2]=0
    [19-MAY-2004 13:57:31:384] snttcallback: op = 5, bytes = 0, err = 995
    [19-MAY-2004 13:57:31:384] ntt2err: soc 1420 error - operation=5, ntresnt[0]=530, ntresnt[1]=995, ntresnt[2]=0
    [19-MAY-2004 13:57:31:384] snttcallback: op = 5, bytes = 0, err = 995
    [19-MAY-2004 13:57:31:384] ntt2err: soc 1420 error - operation=5, ntresnt[0]=530, ntresnt[1]=995, ntresnt[2]=0
    [19-MAY-2004 13:57:31:384] snttcallback: op = 5, bytes = 0, err = 995
    [19-MAY-2004 13:57:31:384] ntt2err: soc 1420 error - operation=5, ntresnt[0]=530, ntresnt[1]=995, ntresnt[2]=0
    [19-MAY-2004 13:57:31:384] nsclose: closing transport
    [19-MAY-2004 13:57:31:484] nsclose: global context check-out (from slot 1) complete

    Thanks Mark.
    Unfortunately I'm not currently in a position to test on Unix, but understand that I need to do so. It may be a couple of weeks before I can test on Linux, as "IT Support" will need to install an OS version officially supported by Oracle. If we win the work we'll have the required hardware, but we have to demonstrate it working first.
    Note, in my test circumstance transfers work fine using FTP, and only fail using WebDAV when the file extension is not .xml.

  • Huge memory usage while parsing a large number of files

    hi,
    I use ORACLE8i XML parser class in my app.The problem is that
    when I parse a large number of xml files ,memory usage is so
    huge as more than 100M byte.Even worse,sometime I saw virtual
    memory low dialog.Could anybody give me some idea about this.
    any reply are welcome.Thanks a lot.

    Hi Mike. Yes I do have this enabled but this should only be requesting login to view the normal (open) applications. What I end up getting, after I login, is all the applications restarting. In the case of the synchronising files the database has to rebuild itself every time (160,000 files), and nothing has been happening while logged out. Using the Caffeine app I have still enabled the screensaver using a hot corner and had to log back in after 10 minutes but all the applications were still running, including the synchronisation. I am pretty sure my laptop has not gone into sleep mode, or it wouldn't have to reopen the apps, but it also has not shutdown as I get a login box as soon as I press any key. I can't understand the problem, and what makes it even stranger is that it is happening on two separate MacBooks at the same time. Thanks for the suggestion – really appreciated.
    OldGnome - thanks for the suggestion for the other app. I chose Caffeine as this has really good user reviews but the other one doesn't seem to have any, but I might still try it. Again thanks for your help.

  • Import/Export Large Complex XMl files(700MB) to MySQL tables

    Am creating an application that will be mporting large and complex XML file in the range of 500-1000MB size. An xml ile wil have 5-6 levels of xml tags where the first tag will be the client account configuration e.g name, location, address, the second will be orders made, the third will be order items, fourth will be item defination...etc. The following is a sample structure of the file.
    <mycompany_sales> <customer name="me">   <location country="Kenya">     <town>nairobi</toen>     <order id="20000" date="2008-09-08">         <item id="4000">             <stock>2000</stock>           <buying>300.0</buying>       </item>       ........       <total>5000</total>   </order>   .............. </location> </customer> ........... </mycompany_sales>
    Because of the size, if i process this file using DOM it will result to out of memory error. I have tried parsing with SAX but it takes about 18 hours to process which is not ideal. If i import this data to Microsoft Access it takes about 10 minutes to import including it's relationship. i.e. creates the six tables and the foregin key relations.
    I tried using XML-DBMS package but since it relies on DOM, it cant process. Does anyone know of a package that would help me import this data to any JDBC databse and also recreate the same structure of xml from the jdbc db. It would also be ideal if it can create sample map file during import and export.
    Thanks in advance,
    Simon K.

    kagara wrote:
    I tried using XML-DBMS package but since it relies on DOM, it cant process. Does anyone know of a package that would help me import this data to any JDBC databse and also recreate the same structure of xml from the jdbc db. It would also be ideal if it can create sample map file during import and export.So you are parsing the XML, extracting the schema, using jdbc to create it, then parsing the data and using jdbc to populate it.
    I suggest that you just create SQL directly. Or perhaps a import file if MySQL has it.
    Less impact on the database, easier to test, easier to verify, and much faster to actually apply the data.

  • Cannot parse UTF-8 encoded xml files

    I have been having issues parsing files that were encoded with UTF-8. If I save the file as standard ANSI and parse it I do not have the issues.
    Is there a reason this can occur?
    Here is the error I am getting:
    C:\Home\Java\testbed\tmp>java RFKGenerator -in 4874.xml -xsl cl_rfk.xsl -out 4874.rfk
    Applying stylesheet cl_rfk.xsl...
    Exception in thread "main" ; SystemID: file:///C:/Home/Java/testbed/tmp/2.209_M_
    4874.xml; Line#: 1; Column#: -1
    javax.xml.transform.TransformerException: Document root element is missing.
    at org.apache.xalan.transformer.TransformerImpl.fatalError(Unknown Sourc
    e)
    at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source
    at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source
    at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source
    at gov.nasa.jsc.odfxml.java.RFKGenerator.main(RFKGenerator.java:89)
    As I mentioned before this only occurs if the file is encoded in UTF-8 so I am not sure if there is any extra steps needed when parsing these type of files. I am using the latest xalan parser and the xerces processor that apache provides.
    If you need any other information please let me know.
    thank you.

    I found that the issue was I was using an older version of Xalan and when updated it fixed the problem. Also there are issues with parsing UTF-8 on win9x machines you should be on Win2k/XP to not encounter errors.

  • Parsing Error is struts xml files org.xml.s

    Hello ,
    I am getting a peculiar error while starting the Tomcat , the struts xml files are not being parsed correctly (they used to be before) .I get a parse error when I shut/start the tomcat (at each deployment) and hence due to the error the application fails (I guess ...)
    The errors I get on the log file while starting the tomcat are ...(only part of the error stack)
    parsing error processing resource path /WEB-INF/struts-action.xml
    org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    Servlet /ProteinBank threw load() exception
    javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-action.xml

    Have you changed your struts-config or web.xml files?
    Back it up, and try starting with a 'minimal' version of struts-config to see if it succeeds.

  • Problems with parsing and display a XML-File

    Hi,
    I'm working on an applet to read a XML-file, display the content in a JTree, in order to modify and save it again. I found this tutorial: http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/index.html
    I took this example http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/work/DomEcho02.java and modified it, to run it as an applet.
    I changed the method main into:
    public class EditorTest extends JApplet {
    public void init(){
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         try {
              DocumentBuilder builder = factory.newDocumentBuilder();
              File file = new File("/path/inhalt.xml");
              document = builder.parse(file);
         } catch (SAXException sxe) {
              // Error generated during parsing)
              Exception     x = sxe;
              if (sxe.getException() != null)
                   x = sxe.getException();
              x.printStackTrace();
         catch (ParserConfigurationException pce) {
              // Parser with specified options can't be built
              pce.printStackTrace();
         } catch (IOException ioe) {
              // I/O error
              ioe.printStackTrace();
         makeWindow(); //equals makeFrame(); in the tutorial
    } //initThe method makeWindow() looks like this:
    private Container container;
    private void makeWindow(){
         container = getContentPane();
         JDesktopPane desktop = new JDesktopPane();
         final EditorTest echoPanel = new EditorTest();
         JMenuBar menuBar = MakeMenuBar();  //returns a JMenuBar with a few items in it
         container.add(menuBar, BorderLayout.NORTH);
    }The constructor:
    public DomEcho02() {
         // Set up the tree
         JTree tree = new JTree(new DomToTreeModelAdapter());
         // Build left-side view
         JScrollPane treeView = new JScrollPane(tree);
         treeView.setPreferredSize( new Dimension( leftWidth, windowHeight ));
         // Build right-side view
         final JEditorPane htmlPane = new JEditorPane("text/html","");
         htmlPane.setEditable(true);
         JScrollPane htmlView = new JScrollPane(htmlPane);
         htmlView.setPreferredSize(new Dimension( rightWidth, windowHeight ));
         // Build split-pane view
         JSplitPane splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, treeView, htmlView );
         splitPane.setContinuousLayout( true );
         splitPane.setDividerLocation( leftWidth );
         splitPane.setPreferredSize( new Dimension( windowWidth + 10, windowHeight+10 ));
         // Add GUI components
         this.setLayout(new BorderLayout());
         this.add("Center", splitPane );
    } // ConstructorI didn't change the class AdapterNode and DomToTreeModelAdapter. When I change the line "JTree tree = new JTree(new DomToTreeModelAdapter());" into "JTree tree = new JTree();", the applet starts and display a standard-JTree, as it ist generated by the constructor. If I want to display my own Tree the applet fails. When I start it with the appletviewer I get this message:
    java.lang.NullPointerException
    at DomEcho02$AdapterNode.childCount(DomEcho02.java:151)
    at DomEcho02$DomToTreeModelAdapter.isLeaf(DomEcho02.java:167)
    at javax.swing.JTree.setModel(JTree.java:704)
    at javax.swing.JTree.<init>(JTree.java:511)
    at DomEcho02.<init>(DomEcho02.java:51)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:721)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:650)
    at sun.applet.AppletPanel.run(AppletPanel.java:324)
    at java.lang.Thread.run(Thread.java:595)
    Is there anyone out there, who knows how to fix it?
    Thanks in advance.

    I found out, how it was going wrong.
    When the applet started, it didn't start with the method init(), as it should do, it started with the constructor. Because there was no document the method childCount() throws a exception. After this, the method init() startet reading the file and started the constructor again, but the results were not shown.
    After knowing this I decided to write the Applet again and now it's working fine.

Maybe you are looking for

  • Wlc 5508 not responing even in console

    Hi everyone, We have a Cisco wlc 5508 (with 50 LAP) running perfectly until yesterday when the wlc suddently stopped working completly. When we reboot the wlc, only ps1/ps2 led are on (alm led is off). We tried to reset the wlc but the wlc is unreach

  • What are the groups of Mac OS

    Hi Who can explain to me what are the groups "staff", "system", "admin",  I saw "wheel" also, and others What is their meaning and what is their action ? Thanks

  • Can Any SATA Drive (including SATA 1 drives) be Used on MacPro?

    Can one install and use any SATA drive (including a SATA 1) drive on a Mac Pro? I am thinking about using a WD Caviar SE16 but it would appear to be a SATA 1 drive (1.5 GB/s drive). Do all SATA drives have the same connector (that is compatible with

  • Save Search Running Very Slow

    I have a custom page with a query Bean and have Simple, Advanced and View Panels enabled. My Search functionality works great, very fast. However, when I save a search... any search... no matter how small the resultset...When I go into the views pane

  • How to swap two primitive dataelements using swap function??

    How to write a swap function that can swap two integer..??