You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2001/12/14 22:37:10 UTC

DO NOT REPLY [Bug 5437] New: - Segementation Fault @ parser.parse

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5437>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5437

Segementation Fault @ parser.parse

           Summary: Segementation Fault @ parser.parse
           Product: Xerces2-J
           Version: 2.0.0 [beta 3]
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: DOM
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: patsabhishek@hotmail.com


The following program works fine on Windows and Solaris platform.

On Linux platform I get Segementation Fault @ the line parser.parse

If I specify a non-existent file the program gives a FileNotFoundException
It means even on Linux the program gets the file.

the commands I use are

javac -classpath .:xerces.jar DOM.java
java -classpath .:xerces.jar DOM web.xml

I'm not sure whether the bug is in the xerces library or the JVM for linux.

Any help is appreciated.

If you fix this please let me know.

Thanks and Regards,


// source file starts here

import org.w3c.dom.*;
import org.apache.xerces.parsers.DOMParser;

public class DOM
{
    public static void main(String[] args) 
    {

        try {
            DOMParser parser = new DOMParser();
            parser.parse(args[0]);
            Document doc = parser.getDocument();

            NodeList nodes = doc.getElementsByTagName("servlet");
            System.out.println("There are " + nodes.getLength() + "  
elements.");

        } catch (Exception ex) {
            System.out.println(ex);
        }
    }
}


// source file ends here


// xml file starts here

<?xml version="1.0" encoding="ISO-8859-1"?>
<N>
  <A>  
    <servlet servletIndex= "0" />    
    <servlet servletIndex= "1" />    
    <servlet servletIndex= "2" />    
    <servlet servletIndex= "3" />    
  </A>
</N>

// xml file ends here

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org