You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Alex Aw Seat Kiong <al...@bigonthenet.com> on 2004/07/07 06:20:16 UTC

upgrade from Lucene 1.3 final to 1.4rc3 problem

Hi!

I'm using Lucene 1.3 final currently, all things were working fine.
But, after i'm upgraded from Lucene 1.3 final to 1.4rc3 (simply overwrite the lucene-1.4-final.jar to lucene-1.4-rc3.jar and re-compile it)
We can re-compile it successfuly. but when will try to index the document. It give the error as below:
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:173)
Which wrong? Pls help.

Thanks.

Regards,
Alex




Re: upgrade from Lucene 1.3 final to 1.4rc3 problem

Posted by Maxim Patramanskij <ma...@osua.de>.
Hello Alex.

I had the similar problem when I've upgraded to Lucene 1.4 rc3 from
1.3 final.

After short investigation, I realized that problem is in the
code of constructor FSDirectory() below:

private FSDirectory(File path, boolean create) throws IOException {
 directory = path;
 lockDir = new File(LOCK_DIR);
   if (!lockDir.isAbsolute()) {
     lockDir = new File(directory, LOCK_DIR);
   }
 [...]

 }
The LOCK_DIR constant, deefined as:

public static final String LOCK_DIR =
    System.getProperty("org.apache.lucene.lockdir",
      System.getProperty("java.io.tmpdir", "."));

may have one of the following values :

System.getProperty("org.apache.lucene.lockdir") if it has been set before

System.getProperty("java.io.tmpdir") if it has been set before

"." if no one of above properties specified.

In my case (I'm running Lucene under Tomcat 4.1.27 on WinXp) "java.io.tmpdir"
was set to "..\temp" by Tomcat startup script.

Therefore, the check of lockDir.isAbsolute() returned false and
lockDir was assigned with instance of File(MY_INDEX_DIRECTORY, "..\temp").

Because there was no directory "temp" corresponding to one level above
MY_INDEX_DIRECTORY, method create() threw
NullPointerException when there was a try to access files.length,
because files variable already had null value after calling

files = lockDir.list();



I solved this problem by changing Tomcat startup script the way that
it sets java.io.tmpdir to absolute path.

However, Lucene 1.4 final release is announced by Doug on July, 2 and
available here
http://cvs.apache.org/dist/jakarta/lucene/v1.4-final/

The code for obtaining lockDir location and LOCK_DIR constant has been
changed:

private FSDirectory(File path, boolean create) throws IOException {
 directory = path;
    if (LOCK_DIR == null) {
      lockDir = directory;
    }
    else {
      lockDir = new File(LOCK_DIR);
    }
[...]
}

  public static final String LOCK_DIR =
    System.getProperty("org.apache.lucene.lockdir",
      System.getProperty("java.io.tmpdir"));

The above changes stay that if no one of  "org.apache.lucene.lockdir" or
"java.io.tmpdir" has been set before starting indexing, then lockfile
will be created in the same directory where index files are located.
      
With 1.4 final everything is working just fine for without having to change
Tomcat startup script.


Hope this will help.


Best regards,
 Maxim


Wednesday, July 7, 2004, 7:20:16 AM, you wrote:

AASK> Hi!

AASK> I'm using Lucene 1.3 final currently, all things were working fine.
AASK> But, after i'm upgraded from Lucene 1.3 final to 1.4rc3 (simply overwrite the lucene-1.4-final.jar to lucene-1.4-rc3.jar and re-compile it)
AASK> We can re-compile it successfuly. but when will try to index the document. It give the error as below:
AASK> java.lang.NullPointerException
AASK>         at org.apache.lucene.store.FSDirectory.create(FSDirectory.java:146)
AASK>         at org.apache.lucene.store.FSDirectory.<init>(FSDirectory.java:126)
AASK>         at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:102)
AASK>         at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:83)
AASK>         at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:173)
AASK> Which wrong? Pls help.

AASK> Thanks.

AASK> Regards,
AASK> Alex


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


Re: upgrade from Lucene 1.3 final to 1.4rc3 problem

Posted by Alex Aw Seat Kiong <al...@bigonthenet.com>.
Hi!

Thanks, the problem was sovled by using lucene1.4 final.

Regards,
AlexAw


----- Original Message ----- 
From: "Zilverline info" <in...@zilverline.org>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Wednesday, July 07, 2004 10:32 PM
Subject: Re: upgrade from Lucene 1.3 final to 1.4rc3 problem


> This is a bug (see posting 'Lockfile Problem Solved'), upgrade to
> 1.4-final, and you'll be fine
>
> Alex Aw Seat Kiong wrote:
>
> >Hi!
> >
> >I'm using Lucene 1.3 final currently, all things were working fine.
> >But, after i'm upgraded from Lucene 1.3 final to 1.4rc3 (simply overwrite
the lucene-1.4-final.jar to lucene-1.4-rc3.jar and re-compile it)
> >We can re-compile it successfuly. but when will try to index the
document. It give the error as below:
> >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:173)
> >Which wrong? Pls help.
> >
> >Thanks.
> >
> >Regards,
> >Alex
> >
> >
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>


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


Re: upgrade from Lucene 1.3 final to 1.4rc3 problem

Posted by Zilverline info <in...@zilverline.org>.
This is a bug (see posting 'Lockfile Problem Solved'), upgrade to 
1.4-final, and you'll be fine

Alex Aw Seat Kiong wrote:

>Hi!
>
>I'm using Lucene 1.3 final currently, all things were working fine.
>But, after i'm upgraded from Lucene 1.3 final to 1.4rc3 (simply overwrite the lucene-1.4-final.jar to lucene-1.4-rc3.jar and re-compile it)
>We can re-compile it successfuly. but when will try to index the document. It give the error as below:
>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:173)
>Which wrong? Pls help.
>
>Thanks.
>
>Regards,
>Alex
>
>
>
>
>  
>



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


Lucene 1.3 final to 1.4final problem

Posted by Karthik N S <ka...@controlnet.co.in>.
Hey

Dev Guys

Apologies....


 Can Some body Explain me

  Why  for an I/P word "TA1111" to  the StopAnalyzer.java  returns  [ta]
instead of [ta1111]

  "TA1111"  ==> [ta]   instead of  [ta1111]

  "$125.96  === [125.95] instead of [$125.95]

  Is it something wrong I have been missing.


 with regards
Karthik




-----Original Message-----
From: Karthik N S [mailto:karthik@controlnet.co.in]
Sent: Thursday, July 08, 2004 11:59 AM
To: Lucene Users List
Subject: Lucene 1.3 final to 1.4final problem


Hey

Dev Guys

Apologies ....

I have a Quick Problem...

  The no of Hits on set of Documents  indexed using 1.3-final  is not same
on  1.4-final  version
  [ The only modification done to the src is , I have upgraded my
CustomAnalyzer  on basis of StopAnalyzer avaliable in 1.4 ]
  Does doing this effect the performance.


  Some body please explain.


with regards
Karthik




-----Original Message-----
From: Alex Aw Seat Kiong [mailto:alex.aw@bigonthenet.com]
Sent: Wednesday, July 07, 2004 9:50 AM
To: Lucene Users List
Subject: upgrade from Lucene 1.3 final to 1.4rc3 problem


Hi!

I'm using Lucene 1.3 final currently, all things were working fine.
But, after i'm upgraded from Lucene 1.3 final to 1.4rc3 (simply overwrite
the lucene-1.4-final.jar to lucene-1.4-rc3.jar and re-compile it)
We can re-compile it successfuly. but when will try to index the document.
It give the error as below:
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:173)
Which wrong? Pls help.

Thanks.

Regards,
Alex





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


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


Lucene 1.3 final to 1.4final problem

Posted by Karthik N S <ka...@controlnet.co.in>.
Hey

Dev Guys

Apologies ....

I have a Quick Problem...

  The no of Hits on set of Documents  indexed using 1.3-final  is not same
on  1.4-final  version
  [ The only modification done to the src is , I have upgraded my
CustomAnalyzer  on basis of StopAnalyzer avaliable in 1.4 ]
  Does doing this effect the performance.


  Some body please explain.


with regards
Karthik




-----Original Message-----
From: Alex Aw Seat Kiong [mailto:alex.aw@bigonthenet.com]
Sent: Wednesday, July 07, 2004 9:50 AM
To: Lucene Users List
Subject: upgrade from Lucene 1.3 final to 1.4rc3 problem


Hi!

I'm using Lucene 1.3 final currently, all things were working fine.
But, after i'm upgraded from Lucene 1.3 final to 1.4rc3 (simply overwrite
the lucene-1.4-final.jar to lucene-1.4-rc3.jar and re-compile it)
We can re-compile it successfuly. but when will try to index the document.
It give the error as below:
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:173)
Which wrong? Pls help.

Thanks.

Regards,
Alex





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


Upgrade from Lucene 1.3 final to 1.4 problem

Posted by Karthik N S <ka...@controlnet.co.in>.
Hey

Apologies ....

  Same with me tooo...

  The no of Hits on set of Documents  indexed using 1.3-final  is not same
on  1.4-final  version
  [ The only modification done to the src is , I have upgraded my
CustomAnalyzer  on basis of StopAnalyzer avaliable in 1.4 ]
  Does doing this effect the performance.


  Some body please explain.


with regards
Karthik

-----Original Message-----
From: Alex Aw Seat Kiong [mailto:alex.aw@bigonthenet.com]
Sent: Wednesday, July 07, 2004 9:50 AM
To: Lucene Users List
Subject: upgrade from Lucene 1.3 final to 1.4rc3 problem


Hi!

I'm using Lucene 1.3 final currently, all things were working fine.
But, after i'm upgraded from Lucene 1.3 final to 1.4rc3 (simply overwrite
the lucene-1.4-final.jar to lucene-1.4-rc3.jar and re-compile it)
We can re-compile it successfuly. but when will try to index the document.
It give the error as below:
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:173)
Which wrong? Pls help.

Thanks.

Regards,
Alex





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