Help save net neutrality! Learn more.
Close

Document root element is missing

Help
Ned Lowe
2008-06-11
2013-04-25
  • Ned Lowe

    Ned Lowe - 2008-06-11

    Hi,

    Apologies in advance if this is obvious or covered in some documentation some where.  I looked for a while but couldn't find anything.

    When I run "java -jar statsvn.jar logfile.log /path/to/module"

    I get:
    Jun 11, 2008 11:52:31 AM net.sf.statsvn.util.JavaUtilTaskLogger info
    INFO: StatSVN - SVN statistics generation

    Parsing SVN log 'logfile.log' exclude pattern 'null'
    Repositories: org.xml.sax.SAXParseException: Document root element is missing.
    Exception in thread "main" java.lang.NullPointerException
            at org.apache.xalan.serialize.SerializerToXML.writeAttrString(SerializerToXML.java:2349)
            at org.apache.xalan.serialize.SerializerToXML.processAttribute(SerializerToXML.java:1108)
            at org.apache.xalan.serialize.SerializerToXML.startElement(SerializerToXML.java:968)
            at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1020)
            at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:379)
            at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:191)
            at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:325)
            at net.sf.statsvn.util.XMLUtil.writeXmlFile(XMLUtil.java:140)
            at net.sf.statsvn.input.SvnLogfileParser.handleLineCounts(SvnLogfileParser.java:114)
            at net.sf.statsvn.input.SvnLogfileParser.parse(SvnLogfileParser.java:343)
            at net.sf.statsvn.Main.generateDefaultHTMLSuite(Main.java:278)
            at net.sf.statsvn.Main.generateDefaultHTMLSuite(Main.java:240)
            at net.sf.statsvn.Main.generate(Main.java:115)
            at net.sf.statsvn.Main.main(Main.java:81)

    I tried, and logfile.log loads as valid XML elsewhere...

    Any pointers?

    Thanks a lot,
    Ned

     
    • Jason Kealey

      Jason Kealey - 2008-06-11

      StatSVN appears to have trouble working with your cached line counts. (Which are stored in a folder called .statsvn in your user's home directory).

      Can you look at the existing repositories.xml and cache_*.xml files to figure out if one of these files was corrupted?

       
      • Ned Lowe

        Ned Lowe - 2008-06-11

        Thanks a lot.

        The file 'repositories.xml' existed but had a file size of 0.  There were no cache_* files.  I deleted the folder, and ran the jar again.  The same error was thrown again, except for the reference to an XML file:

        DSP_EQT_DEV:~/SOURCE/gmist_dspgloss/StatSVN$ java -jar statsvn.jar logfile.log ../branches/10.2
        Jun 11, 2008 5:53:14 PM net.sf.statsvn.util.JavaUtilTaskLogger info
        INFO: StatSVN - SVN statistics generation

        Parsing SVN log 'logfile.log' exclude pattern 'null'
        Exception in thread "main" java.lang.NullPointerException
                at org.apache.xalan.serialize.SerializerToXML.writeAttrString(SerializerToXML.java:2349)
                at org.apache.xalan.serialize.SerializerToXML.processAttribute(SerializerToXML.java:1108)
                at org.apache.xalan.serialize.SerializerToXML.startElement(SerializerToXML.java:968)
                at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1020)
                at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:379)
                at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:191)
                at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:325)
                at net.sf.statsvn.util.XMLUtil.writeXmlFile(XMLUtil.java:140)
                at net.sf.statsvn.input.SvnLogfileParser.handleLineCounts(SvnLogfileParser.java:114)
                at net.sf.statsvn.input.SvnLogfileParser.parse(SvnLogfileParser.java:343)
                at net.sf.statsvn.Main.generateDefaultHTMLSuite(Main.java:278)
                at net.sf.statsvn.Main.generateDefaultHTMLSuite(Main.java:240)
                at net.sf.statsvn.Main.generate(Main.java:115)
                at net.sf.statsvn.Main.main(Main.java:81)

        Not very helpful error :-/

        Any thoughts?

        Thanks again,
        Ned

         
        • Jason Kealey

          Jason Kealey - 2008-06-11

          Okay, this appears to be an error we sometimes get with StatSVN. Simply put, it appears to be an issue with the Xalan parser.

          We create a new instance of a javax.xml.transform.TransformerFactory (see http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/TransformerFactory.html\) and your system is configured to use Xalan. For some reason, non-standard XML transformers seem to have issues with StatSVN. There are system properties you can set to use the default one instead of Xalan (see URL) but I'm not sure what the default is.

          If you manage to find which Java property to set to make it use the default one, please share it here!

           

Log in to post a comment.