org.compass.core.engine.SearchEngineException: Failed to rename index [target/test-index/index/user] to [target\test-index\index\user-copy0]

AppFuse JIRA | J. Garcia | 6 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    In modular archetype, Struts2 framework: mvn clean test produces errors related to compass. ------------------------------------------------------------------------------- Test set: com.mycompany.webapp.listener.StartupListenerTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.042 sec <<< FAILURE! testContextInitialized(com.mycompany.webapp.listener.StartupListenerTest) Time elapsed: 6.037 sec <<< ERROR! org.compass.core.engine.SearchEngineException: Failed to rename index [target/test-index/index/user] to [target\test-index\index\user-copy0] at org.compass.core.lucene.engine.store.FSDirectoryStore.beforeCopyFrom(FSDirectoryStore.java:157) at org.compass.core.lucene.engine.store.DefaultLuceneSearchEngineStore.copyFrom(DefaultLuceneSearchEngineStore.java:616) at org.compass.core.lucene.engine.store.DefaultLuceneSearchEngineStore.copyFrom(DefaultLuceneSearchEngineStore.java:602) at org.compass.core.lucene.engine.manager.DefaultLuceneSearchEngineIndexManager$ReplaceIndexOperationCallback$1$1.run(DefaultLuceneSearchEngineIndexManager.java:298) at org.compass.core.lucene.engine.manager.IndexHoldersCache.doUnderCacheLock(IndexHoldersCache.java:126) etc... My solution: 1. moved all compass-related beans from WEB-INF/applicationContext.xml to applicationContext-dao.xml from core module:compass, compassPostProcessor, compassTemplate, compassSearchHelper, compassGps, with: <bean id="compass" class="org.compass.spring.LocalCompassBean"> <property name="mappingScan" value="es.isigma.promotions"/> <property name="postProcessor" ref="compassPostProcessor"/> <property name="transactionManager" ref="transactionManager" /> <property name="settings"> <map> <entry key="compass.engine.connection" value="${compass.storage.dir}" /> </map> </property> </bean> and in pom.xml: <properties> <compass.storage.dir>ram://index</compass.storage.dir> 2. Set the real storage in packaged application: 2.1: Add this in web's pom.xml: <plugin> + <artifactId>maven-war-plugin</artifactId> + <version>2.1.1</version> + <configuration> + <filters> + <filter>target/classes/compass-filter.properties</filter> + </filters> + <webResources> + <resource> + <directory>../core/src/main/resources</directory> + <targetPath>WEB-INF/classes</targetPath> + <filtering>true</filtering> + <includes> + <include>applicationContext-dao.xml</include> + </includes> + </resource> + </webResources> + <archive> + <manifest> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + </manifest> + <manifestEntries> + <Implementation-Version>${project.version}</Implementation-Version> + </manifestEntries> + </archive> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>war</goal> + </goals> + </execution> + </executions> + </plugin> 2.2. Add the filter file: web/src/main/resources/compass-filter.properties: compass.storage.dir=/home/portasigma/${db.name}/index

    AppFuse JIRA | 6 years ago | J. Garcia
    org.compass.core.engine.SearchEngineException: Failed to rename index [target/test-index/index/user] to [target\test-index\index\user-copy0]
  2. 0

    In modular archetype, Struts2 framework: mvn clean test produces errors related to compass. ------------------------------------------------------------------------------- Test set: com.mycompany.webapp.listener.StartupListenerTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.042 sec <<< FAILURE! testContextInitialized(com.mycompany.webapp.listener.StartupListenerTest) Time elapsed: 6.037 sec <<< ERROR! org.compass.core.engine.SearchEngineException: Failed to rename index [target/test-index/index/user] to [target\test-index\index\user-copy0] at org.compass.core.lucene.engine.store.FSDirectoryStore.beforeCopyFrom(FSDirectoryStore.java:157) at org.compass.core.lucene.engine.store.DefaultLuceneSearchEngineStore.copyFrom(DefaultLuceneSearchEngineStore.java:616) at org.compass.core.lucene.engine.store.DefaultLuceneSearchEngineStore.copyFrom(DefaultLuceneSearchEngineStore.java:602) at org.compass.core.lucene.engine.manager.DefaultLuceneSearchEngineIndexManager$ReplaceIndexOperationCallback$1$1.run(DefaultLuceneSearchEngineIndexManager.java:298) at org.compass.core.lucene.engine.manager.IndexHoldersCache.doUnderCacheLock(IndexHoldersCache.java:126) etc... My solution: 1. moved all compass-related beans from WEB-INF/applicationContext.xml to applicationContext-dao.xml from core module:compass, compassPostProcessor, compassTemplate, compassSearchHelper, compassGps, with: <bean id="compass" class="org.compass.spring.LocalCompassBean"> <property name="mappingScan" value="es.isigma.promotions"/> <property name="postProcessor" ref="compassPostProcessor"/> <property name="transactionManager" ref="transactionManager" /> <property name="settings"> <map> <entry key="compass.engine.connection" value="${compass.storage.dir}" /> </map> </property> </bean> and in pom.xml: <properties> <compass.storage.dir>ram://index</compass.storage.dir> 2. Set the real storage in packaged application: 2.1: Add this in web's pom.xml: <plugin> + <artifactId>maven-war-plugin</artifactId> + <version>2.1.1</version> + <configuration> + <filters> + <filter>target/classes/compass-filter.properties</filter> + </filters> + <webResources> + <resource> + <directory>../core/src/main/resources</directory> + <targetPath>WEB-INF/classes</targetPath> + <filtering>true</filtering> + <includes> + <include>applicationContext-dao.xml</include> + </includes> + </resource> + </webResources> + <archive> + <manifest> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + </manifest> + <manifestEntries> + <Implementation-Version>${project.version}</Implementation-Version> + </manifestEntries> + </archive> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>war</goal> + </goals> + </execution> + </executions> + </plugin> 2.2. Add the filter file: web/src/main/resources/compass-filter.properties: compass.storage.dir=/home/portasigma/${db.name}/index

    AppFuse JIRA | 6 years ago | J. Garcia
    org.compass.core.engine.SearchEngineException: Failed to rename index [target/test-index/index/user] to [target\test-index\index\user-copy0]

    Root Cause Analysis

    1. org.compass.core.engine.SearchEngineException

      Failed to rename index [target/test-index/index/user] to [target\test-index\index\user-copy0]

      at org.compass.core.lucene.engine.store.FSDirectoryStore.beforeCopyFrom()
    2. Compass
      IndexHoldersCache.doUnderCacheLock
      1. org.compass.core.lucene.engine.store.FSDirectoryStore.beforeCopyFrom(FSDirectoryStore.java:157)
      2. org.compass.core.lucene.engine.store.DefaultLuceneSearchEngineStore.copyFrom(DefaultLuceneSearchEngineStore.java:616)
      3. org.compass.core.lucene.engine.store.DefaultLuceneSearchEngineStore.copyFrom(DefaultLuceneSearchEngineStore.java:602)
      4. org.compass.core.lucene.engine.manager.DefaultLuceneSearchEngineIndexManager$ReplaceIndexOperationCallback$1$1.run(DefaultLuceneSearchEngineIndexManager.java:298)
      5. org.compass.core.lucene.engine.manager.IndexHoldersCache.doUnderCacheLock(IndexHoldersCache.java:126)
      5 frames