You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Ralph Schaer <ra...@yahoo.com> on 2004/04/01 07:40:46 UTC

FSDirectory Problem

Hello

I try to update a web application from 1.4-rc1 to 1.4-rc2. But that's 
not working. An error occurrs. The application is running inside tomcat 
5.0.19.

Here's the code:

File f = 
(File)servlet.getServletContext().getAttribute("javax.servlet.context.tempdir");
File ixDir = new File(f, "index");
IndexWriter writer = new IndexWriter(ixDir.getPath(), new 
StandardAnalyzer(), true)

and here's the error.

java.lang.NullPointerException
	at org.apache.lucene.store.FSDirectory.create(FSDirectory.java:146)
	at org.apache.lucene.store.FSDirectory.<init>(FSDirectory.java:126)
	at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:102)
	at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:83)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:172)


The code works with lucene 1.4-rc1.

Regards
Ralph


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: FSDirectory Problem

Posted by Ralph Schaer <ra...@yahoo.com>.
>>-----Original Message-----
>>From: news
>>
>>I try to update a web application from 1.4-rc1 to 1.4-rc2. 
>>But that's not working. An error occurrs. The application is 
>>running inside tomcat 5.0.19.
>>
> 
> 
> As I said in one off the previous mails, the TC is the problem not Lucene.
> TC wronlgly sets java.io.tmpdir to be a relative path instead absolute.
> So edit your catalina.bat or just download 5.0.21


Thanks for your answert. But I'm wondering why it's working with 1.4-rc1?

Ralph


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


RE: FSDirectory Problem

Posted by Mladen Turk <mt...@apache.org>.
 

> -----Original Message-----
> From: news
> 
> I try to update a web application from 1.4-rc1 to 1.4-rc2. 
> But that's not working. An error occurrs. The application is 
> running inside tomcat 5.0.19.
> 

As I said in one off the previous mails, the TC is the problem not Lucene.
TC wronlgly sets java.io.tmpdir to be a relative path instead absolute.
So edit your catalina.bat or just download 5.0.21

MT.


> Here's the code:
> 
> File f =
> (File)servlet.getServletContext().getAttribute("javax.servlet.
> context.tempdir");
> File ixDir = new File(f, "index");
> IndexWriter writer = new IndexWriter(ixDir.getPath(), new 
> StandardAnalyzer(), true)
> 
> and here's the error.
> 
> java.lang.NullPointerException
> 	at 
> org.apache.lucene.store.FSDirectory.create(FSDirectory.java:146)
> 	at 
> org.apache.lucene.store.FSDirectory.<init>(FSDirectory.java:126)
> 	at 
> org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:102)
> 	at 
> org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:83)
> 	at 
> org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:172)
> 
> 
> The code works with lucene 1.4-rc1.
> 
> Regards
> Ralph
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org