Hi Terry,
Thanks for your reply.
I identified the problem. I am creating a new index, but passing a parameter
that the index is existing one. So, it is looking for segment file (thinking
that the index is existing).
You rightly pointed out that, i am not calling UseCompoundFile method. I
will incorporate this call.
regards
Prasad
----- Original Message -----
From: "Terry Steichen" <[EMAIL PROTECTED]>
To: "Lucene Users List" <[EMAIL PROTECTED]>
Sent: Thursday, June 03, 2004 2:58 PM
Subject: Re: FileNotFoundException when trying to indexing.
> Prasad,
>
> I think you'll have to provide more code so we can see what's actually
going
> on. BTW, I don't see you calling the UseCompoundFile method (unless you
do
> it inside indexFile/Directory) - I wonder if that could be an issue?
>
> Regards,
>
> Terry
>
> PS: I run on XP/Pro just fine, so there's nothing intrinsically wrong with
> the platform.
>
> ----- Original Message -----
> From: "Prasad Ganguri" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, June 03, 2004 12:59 PM
> Subject: FileNotFoundException when trying to indexing.
>
>
> I am using Lucene for buiding our document management system. I tested it
in
> Windows2000 Professional and got successful execution.
>
> Recently, when we ported the code onto an WindowsXP Professional, we are
> getting the following exception. I tried to create segments folder using
my
> code, but throwing Access denied error.
>
> Could some one help me, what is wrong with my code?
>
> java.io.FileNotFoundException: C:\cms\index\segments (The system cannot
find
> the file specified)
> at java.io.RandomAccessFile.open(Native Method)
> at java.io.RandomAccessFile.<init>(RandomAccessFile.java:204)
> at org.apache.lucene.store.FSInputStream$Descriptor.<init>(Unknown
> Source)
> at org.apache.lucene.store.FSInputStream.<init>(Unknown Source)
> at org.apache.lucene.store.FSDirectory.openFile(Unknown Source)
> at org.apache.lucene.index.SegmentInfos.read(Unknown Source)
> at org.apache.lucene.index.IndexWriter$1.doBody(Unknown Source)
> at org.apache.lucene.store.Lock$With.run(Unknown Source)
> at org.apache.lucene.index.IndexWriter.<init>(Unknown Source)
> at org.apache.lucene.index.IndexWriter.<init>(Unknown Source)
> at
>
com.ganguri.cms.contentmanagement.index.FileIndexer.index(FileIndexer.java:6
> 2)
> at
>
com.ganguri.cms.contentmanagement.filemanager.Document.moveFileToRepository(
> Document.java:215)
> at
>
jsp_servlet._content._indexcardprocess._jspService(_indexcardprocess.java:19
> 3)
> at com.ganguri.cms.jsp.CMSJSPPage.service(CMSJSPPage.java:20)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :105)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :123)
> at
>
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
> l.java:742)
> at
>
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
> l.java:686)
> at
>
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
> Manager.java:247)
> at
>
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
> at
> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
> The corresponding code is as follows:
>
> public static void index(File indexDir, File dataDir, boolean isNew)
throws
> Exception
> {
> if (!dataDir.exists())
> throw new IOException(dataDir.getName() + " does not exist.");
> System.out.println("############ indexDir existing.....? " +
> indexDir.exists());
> IndexWriter writer = null;
> if (!indexDir.exists())
> {
> indexDir.mkdirs();
> }
> try
> {
> writer = new IndexWriter(indexDir, getAnalyzer(), isNew); // Here the
> exception is thrown
> if (dataDir.isFile())
> indexFile(writer, dataDir);
> else if (dataDir.isDirectory())
> indexDirectory(writer, dataDir);
> else
> return;
> writer.optimize();
> writer.close();
> }
> catch (Exception e)
> {
> e.printStackTrace();
> }
> finally
> {
> if (writer != null)
> writer.close();
> }
> }
>
> Thanks in advance..
>
>
> Prasad
>
>
> ---------------------------------------------------------------------
> 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]