lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prasad Ganguri" <gang...@yahoo.com>
Subject FileNotFoundException when trying to indexing.
Date Thu, 03 Jun 2004 16:59:38 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message