Saturday, April 15, 2017

Document Indexes for Lucene in PowerAqua

In the file multi_indexproperties.xml

there are two lines of code:

<INDEX_GLOBAL_PATH>/Applications/apache-tomcat-5.5.23/webapps/poweraqualinked/LuceneIndexes/</INDEX_GLOBAL_PATH>
<INDEX_INFO_FOLDER>./indexListInformation/indexkmiweb07-philips/</INDEX_INFO_FOLDER>

which is referenced by:

./PowerAqua-decompiled/lib/poweraqua/indexingService/creator/MultiIndexServiceConfiguration.java

---------------


list = configuration.getElementsByTagName("POWERMAP");
setPowermap(Boolean.valueOf(list.item(0).getFirstChild().getNodeValue()).booleanValue());
list = configuration.getElementsByTagName("VIRTUOSO");
setVirtuoso(Boolean.valueOf(list.item(0).getFirstChild().getNodeValue()).booleanValue());
list = configuration.getElementsByTagName("REMOTESPARQLVIRTUOSO");
setRemoteSPARQLVirtuoso(Boolean.valueOf(list.item(0).getFirstChild().getNodeValue()).booleanValue());
list = configuration.getElementsByTagName("ONTOLOGY_INDEX_DB");
setDb(list.item(0).getFirstChild().getNodeValue());
list = configuration.getElementsByTagName("ONTOLOGY_INDEX_DB_LOGIN");
setLogin(list.item(0).getFirstChild() != null ? list.item(0).getFirstChild().getNodeValue() : new String());
list = configuration.getElementsByTagName("ONTOLOGY_INDEX_DB_PASSWORD");
setPassword(list.item(0).getFirstChild() != null ? list.item(0).getFirstChild().getNodeValue() : new String());
list = configuration.getElementsByTagName("INDEX_GLOBAL_PATH");
setIndex_global_path(list.item(0).getFirstChild() != null ? list.item(0).getFirstChild().getNodeValue() : new String());

NodeList indexes = configuration.getElementsByTagName("INDEX_INFO_FOLDER");
System.out.println("Number of indexes is " + indexes.getLength());
this.indexList = new ArrayList();
for (int i = 0; i < indexes.getLength(); i++)
{
String indexFolder = indexes.item(i).getFirstChild() != null ? indexes.item(i).getFirstChild().getNodeValue() : null;
MultiOntologyIndexBean bean = new MultiOntologyIndexBean(indexFolder);
getIndexList().add(bean);
}
 ----------------

It fails if INDEX_GLOBAL_PATH or INDEX_INFO_FOLDER is called.. but it contains a null or nothing specified in the tag  ... I think this triggers new String() which triggers a stack trace

No comments:

Post a Comment