SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Could not initialize class org.apache.lucene.index.SegmentReader

This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Pages: 1 - Last Post: Aug 29, 2008 2:50 PM Last Post By: Shay Banon
Thunderstorm

Posts: 11
Registered: 4/25/07
Could not initialize class org.apache.lucene.index.SegmentReader
Posted: Aug 29, 2008 5:43 AM
 
  Click to reply to this thread Reply
I get this exception when trying to do anything that requires updating the index.

Compass Version: 2.0.2
Lucene-Core Version: 2.3.2

Stacktrace:

[ERROR] TransactionSynchronizationUtils - TransactionSynchronization.afterCompletion threw exception <java.lang.NoClassDefFoundError: Could not initialize class org.apache.lucene.index.SegmentReader>java.lang.NoClassDefFoundError: Could not initialize class org.apache.lucene.index.SegmentReader
        at org.apache.lucene.index.DirectoryIndexReader$1.doBody(DirectoryIndexReader.java:73)
        at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:636)
        at org.apache.lucene.index.DirectoryIndexReader.open(DirectoryIndexReader.java:63)
        at org.apache.lucene.index.IndexReader.open(IndexReader.java:209)
        at org.apache.lucene.index.IndexReader.open(IndexReader.java:192)
        at org.compass.core.lucene.engine.manager.LuceneIndexHolder.<init>(LuceneIndexHolder.java:43)
        at org.compass.core.lucene.engine.manager.DefaultLuceneSearchEngineIndexManager.internalRefreshCache(DefaultLuceneSearchEngineIndexManager.java:380)
        at org.compass.core.lucene.engine.manager.DefaultLuceneSearchEngineIndexManager.refreshCache(DefaultLuceneSearchEngineIndexManager.java:358)
        at org.compass.core.lucene.engine.transaction.lucene.LuceneTransaction$CommitCallable.call(LuceneTransaction.java:264)
        at org.compass.core.transaction.context.TransactionalCallable$1.doInTransaction(TransactionalCallable.java:44)
        at org.compass.core.impl.DefaultCompass$CompassTransactionContext.execute(DefaultCompass.java:324)
        at org.compass.core.transaction.context.TransactionalCallable.call(TransactionalCallable.java:41)
        at org.compass.core.executor.DefaultExecutorManager.invokeAllWithLimit(DefaultExecutorManager.java:104)
        at org.compass.core.executor.DefaultExecutorManager.invokeAllWithLimitBailOnException(DefaultExecutorManager.java:73)
        at org.compass.core.lucene.engine.transaction.lucene.LuceneTransaction.doCommit(LuceneTransaction.java:114)
        at org.compass.core.lucene.engine.transaction.AbstractTransaction.commit(AbstractTransaction.java:98)
        at org.compass.core.lucene.engine.LuceneSearchEngine.commit(LuceneSearchEngine.java:174)
        at org.compass.spring.transaction.SpringSyncTransaction$SpringTransactionSynchronization.afterCompletion(SpringSyncTransaction.java:248)
        at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:133)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:951)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:926)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
        at org.compass.spring.transaction.SpringSyncTransaction.doCommit(SpringSyncTransaction.java:140)
        at org.compass.core.transaction.AbstractTransaction.commit(AbstractTransaction.java:46)
        at org.compass.core.CompassTemplate.execute(CompassTemplate.java:131)
        at org.compass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:151)
        at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1.call(ConcurrentParallelIndexExecutor.java:103)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)


I was hoping you might have an idea what is going wrong here. I placed the libraries in the WEB-INF/lib directory.
There is another application on the server which is using compass also. (compass-1.2M2 with lucene-core 2.2.0)
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Could not initialize class org.apache.lucene.index.SegmentReader
Posted: Aug 29, 2008 2:50 PM   in response to: Thunderstorm in response to: Thunderstorm
 
  Click to reply to this thread Reply
This is problematic as Compass 1.2 sets a system property (Lucene way to configure SegmentReader) to set its own SegmentReader. In Compass 2.0, there is no need for that anymore, but when the application that uses 2.0 loads up, it fails since it can't find the CompassSegmentReader in the classpath.

I guess you have two options:

1. Don't run them in the same JVM...
2. Extract the CompassSegmentReader class, and add it to the application that uses Compass 2.0. It won't affect Compass 2.0 at all.
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums