You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by sarfaraz masood <sa...@yahoo.com> on 2010/07/10 01:49:06 UTC

Problem with linux

I have problems when i execute my prog on linux having this following piece of code. 
{

Document d;
 Analyzer analyzer = new PorterStemAnalyzer();
System.out.println("1");
    

Directory index = FSDirectory.open(new File("index1"));
System.out.println("2");

IndexWriter w = new IndexWriter(index, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED ) ; // MY PROG HANGS UP HERE
System.out.println("3");
.
.
.
}


Strangely this exact prog runs well on windows. It simply hangs 
up(doesnt halt) while creating the IndexWriter object in linux. The account via 
which im logged in has sufficient rights for the concerned folder. 


-Sarfaraz




RE: Problem with linux

Posted by sarfaraz masood <sa...@yahoo.com>.
Thanx a lot :-) 
It worked

--- On Sat, 10/7/10, Uwe Schindler <uw...@thetaphi.de> wrote:

From: Uwe Schindler <uw...@thetaphi.de>
Subject: RE: Problem with linux
To: general@lucene.apache.org
Date: Saturday, 10 July, 2010, 5:31 AM

Is the folder mounted on NFS? If yes, use SimpleFSLockFactory.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: sarfaraz masood [mailto:sarfarazmasood2002@yahoo.com]
> Sent: Saturday, July 10, 2010 1:49 AM
> To: general@lucene.apache.org
> Cc: solr
> Subject: Problem with linux
> 
> I have problems when i execute my prog on linux having this following
piece
> of code.
> {
> 
> Document d;
>  Analyzer analyzer = new PorterStemAnalyzer(); System.out.println("1");
> 
> 
> Directory index = FSDirectory.open(new File("index1"));
> System.out.println("2");
> 
> IndexWriter w = new IndexWriter(index, analyzer, true,
> IndexWriter.MaxFieldLength.UNLIMITED ) ; // MY PROG HANGS UP HERE
> System.out.println("3"); .
> .
> .
> }
> 
> 
> Strangely this exact prog runs well on windows. It simply hangs up(doesnt
> halt) while creating the IndexWriter object in linux. The account via
which im
> logged in has sufficient rights for the concerned folder.
> 
> 
> -Sarfaraz
> 
> 





RE: Problem with linux

Posted by Uwe Schindler <uw...@thetaphi.de>.
Is the folder mounted on NFS? If yes, use SimpleFSLockFactory.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: sarfaraz masood [mailto:sarfarazmasood2002@yahoo.com]
> Sent: Saturday, July 10, 2010 1:49 AM
> To: general@lucene.apache.org
> Cc: solr
> Subject: Problem with linux
> 
> I have problems when i execute my prog on linux having this following
piece
> of code.
> {
> 
> Document d;
>  Analyzer analyzer = new PorterStemAnalyzer(); System.out.println("1");
> 
> 
> Directory index = FSDirectory.open(new File("index1"));
> System.out.println("2");
> 
> IndexWriter w = new IndexWriter(index, analyzer, true,
> IndexWriter.MaxFieldLength.UNLIMITED ) ; // MY PROG HANGS UP HERE
> System.out.println("3"); .
> .
> .
> }
> 
> 
> Strangely this exact prog runs well on windows. It simply hangs up(doesnt
> halt) while creating the IndexWriter object in linux. The account via
which im
> logged in has sufficient rights for the concerned folder.
> 
> 
> -Sarfaraz
> 
> 



Re: Problem with linux

Posted by sarfaraz masood <sa...@yahoo.com>.
well thanx a lot Mr Uwe..

This problem solved by making an object of SimpleFSDirectory & passing it to Directory. 

             Directory index = FSDirectory.open(new File("index1"),sfs);

Well Erick i m using Lucene2.9.2.

--- On Sat, 10/7/10, Erick Erickson <er...@gmail.com> wrote:

From: Erick Erickson <er...@gmail.com>
Subject: Re: Problem with linux
To: solr-user@lucene.apache.org
Date: Saturday, 10 July, 2010, 6:32 PM

Well, an awful lot of people use it successfully, so the first
place I'd look is my classpath and be sure you don't have
unexpected jars in there. Perhaps ones from a different
version of Lucene, perhaps ones pointing to "interesting"
places in your JVM. Perhaps.....

Second, have you tried it on any other linux boxes? Is
it possible that the one you're using is hosed?

Without more information though, it's hard to say
anything. You haven't included the version of
Lucene you're using (which is suggested by your
code snippet, perhaps the Lucene user's list would be
a better forum?). Nor the version of your JVM. Nor
your linux version. Nor....

Best
Erick



On Fri, Jul 9, 2010 at 7:49 PM, sarfaraz masood <
sarfarazmasood2002@yahoo.com> wrote:

> I have problems when i execute my prog on linux having this following piece
> of code.
> {
>
> Document d;
>  Analyzer analyzer = new PorterStemAnalyzer();
> System.out.println("1");
>
>
> Directory index = FSDirectory.open(new File("index1"));
> System.out.println("2");
>
> IndexWriter w = new IndexWriter(index, analyzer, true,
> IndexWriter.MaxFieldLength.UNLIMITED ) ; // MY PROG HANGS UP HERE
> System.out.println("3");
> .
> .
> .
> }
>
>
> Strangely this exact prog runs well on windows. It simply hangs
> up(doesnt halt) while creating the IndexWriter object in linux. The account
> via
> which im logged in has sufficient rights for the concerned folder.
>
>
> -Sarfaraz
>
>
>
>



Re: Problem with linux

Posted by Erick Erickson <er...@gmail.com>.
Well, an awful lot of people use it successfully, so the first
place I'd look is my classpath and be sure you don't have
unexpected jars in there. Perhaps ones from a different
version of Lucene, perhaps ones pointing to "interesting"
places in your JVM. Perhaps.....

Second, have you tried it on any other linux boxes? Is
it possible that the one you're using is hosed?

Without more information though, it's hard to say
anything. You haven't included the version of
Lucene you're using (which is suggested by your
code snippet, perhaps the Lucene user's list would be
a better forum?). Nor the version of your JVM. Nor
your linux version. Nor....

Best
Erick



On Fri, Jul 9, 2010 at 7:49 PM, sarfaraz masood <
sarfarazmasood2002@yahoo.com> wrote:

> I have problems when i execute my prog on linux having this following piece
> of code.
> {
>
> Document d;
>  Analyzer analyzer = new PorterStemAnalyzer();
> System.out.println("1");
>
>
> Directory index = FSDirectory.open(new File("index1"));
> System.out.println("2");
>
> IndexWriter w = new IndexWriter(index, analyzer, true,
> IndexWriter.MaxFieldLength.UNLIMITED ) ; // MY PROG HANGS UP HERE
> System.out.println("3");
> .
> .
> .
> }
>
>
> Strangely this exact prog runs well on windows. It simply hangs
> up(doesnt halt) while creating the IndexWriter object in linux. The account
> via
> which im logged in has sufficient rights for the concerned folder.
>
>
> -Sarfaraz
>
>
>
>