The SampleTxtContainsIndexer is a sample only. In Slide 2.2 there will be an improved implementation of a lucene based content indexer, but it is currently only available from the cvs head
See http://wiki.apache.org/jakarta-slide/DaslConfiguration
Stefan
J�r�my Soula wrote:
Thanks for reply
Yes i use the lastest release version of slide and the version 1.3 of SampleTxtContainsIndexer.
Too i create the index and specify an absolute directory.
But i still have the NPE.
Triing to debug, i notice that the variable indexpath is null when i reach the line 173, so the NPE.
I thinked that this variable must be set with the parameter specify in the Domain.xml but it seems not.
(My Domain.xml is the default one).
And when, before the line 173, i initialize the variable indexpath with the absolute directory
like this
<code>
public void initialize(NamespaceAccessToken token)
throws ServiceInitializationFailedException
{
indexpath = token.getNamespaceConfig().getParameter (INDEX_PATH);
IndexWriter indexWriter = null;
this.indexpath="./index";
try
{
indexWriter = new IndexWriter(indexpath, new StandardAnalyzer(), false);
}
// will fail, if not yet exists
catch (IOException e)
{
try
{
// create index
indexWriter = new IndexWriter(indexpath, new StandardAnalyzer(), true);
}
catch (IOException ex)
{
throw new ServiceInitializationFailedException (this, ex);
}
}
try
{
indexWriter.close();
}
catch (IOException e)
{
throw new ServiceInitializationFailedException (this, e);
}
}
</code>
, an index is created and the search with lucene works.
Maybe a bug when the configuration is parsed?
Regards, J�r�my
Martin Kal�n wrote:
J�r�my Soula wrote:
I have the same error with the same config.
<snip/>
java.lang.NullPointerException at java.io.File.<init>(File.java:180) at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:83) at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:173) at org.apache.slide.index.SampleTxtContainsIndexer.initialize(SampleTxtCont ainsIndexer.java:73)
Are you running 2.1 final release?
I checked CVS for line 73 of SampleTxtContainsIndexer.java and saw that
there was a bugfix for a local vs global variable, as you can see here
(note "String indexPath" vs "indexpath"):
http://cvs.apache.org/viewcvs.cgi/jakarta-slide/src/stores/org/apache/slide/index/SampleTxtContainsIndexer.java?r1=1.2&r2=1.3&diff_format=h
If you still get exceptions with v2.1 release, I would assume that Lucene throws this NPE if the directory does not exist.
Since you are using a relative directory "store/index", make sure that this directory exists relative to where you start the JVM with WebLogic.
Alternatively, specify an absolute directory as indexpath.
Regards, Martin
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Stefan L�tzkendorf -- [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
