Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Root element not found error

Help
daisy
2007-08-02
2013-04-17
  • daisy
    daisy
    2007-08-02

    I am a new user of Lius. I want to test the example files that come with Lius. I am trying to run the junit test LiusTestIndexation. I am coming up with this error in all the tests-

    7) testOpenOfficeFactoryIndexing(lius.test.junit.LiusTestIndexation)java.lang.Il
    legalStateException: Root element not set
            at org.jdom.Document.getContent(Document.java:408)
            at org.jaxen.jdom.DocumentNavigator.getChildAxisIterator(DocumentNavigat
    or.java:197)
            at org.jaxen.util.DescendantAxisIterator.next(DescendantAxisIterator.jav
    a:113)
            at org.jaxen.expr.DefaultStep.evaluate(DefaultStep.java:157)
            at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:
    151)
            at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLo
    cationPath.java:117)
            at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:108)
            at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:692)
            at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:229)
            at org.jaxen.BaseXPath.selectSingleNode(BaseXPath.java:248)
            at org.jdom.xpath.JaxenXPath.selectSingleNode(JaxenXPath.java:153)
            at org.jdom.xpath.XPath.selectSingleNode(XPath.java:368)
            at lius.config.LiusConfigBuilder.getAnlyzerClassString(LiusConfigBuilder
    .java:203)
            at lius.config.LiusConfigBuilder.populateLiusConfig(LiusConfigBuilder.ja
    va:131)
            at lius.config.LiusConfigBuilder.getLiusConfig(LiusConfigBuilder.java:11
    9)
            at lius.test.junit.LiusTestIndexation.setUp(LiusTestIndexation.java:83)

    I have added all the required jars to the classpath. Am I missing something?

     
    • Tim Frith
      Tim Frith
      2007-08-03

      Haven't seen much help on this site for months.  So I'll take a shot at this one, even though I'm pretty new to Lius.

      It sounds like a problem with the liusConfig.xml file.

      It's looking for the <analyzer> tag.

      So either:
      -it can't find liusConfig.xml
      -it can't find <analzer> tag
      -it can't find the class listed in <analyzer> tag
      -the liusConfig.xml file is not well-formed xml

      The <analyzer> in my liusConfig.xml looks like this and the class listed is within the Lius jar:

      <properties>
          <analyzer class="org.apache.lucene.analysis.lius.unicode.UTF8AccentRemoverAnalyzer"/>
          <createIndex value="auto"/>
          <indexWriterProperty mergeFactor="10" maxMergeDocs="100" optimize="true"/>
      </properties>

      Hope this helps