3 Replies Latest reply on Dec 6, 2016 9:21 AM by Horia Chiorean

    Exception when commiting changes with lucene

    Vianney Depauw Newbie

      Hi,

       

      Randomly in modeshape 4.6.0.Final I get the exception below. I'm not sure if the bug is due to modeshape or Lucene and I can't reproduce it in a unit test to prove it.

      Since the 5.2.0.Final lot of changes have been made in the related code but I can't migrate right now.

       

      Have you hear about such a problem before that could confirm the nature of the problem?

       

      Caused by: org.modeshape.jcr.index.lucene.LuceneIndexException: Cannot commit index writer
        at org.modeshape.jcr.index.lucene.LuceneIndex.commit(LuceneIndex.java:155) ~[dsdk-launcher.jar:na]
        at org.modeshape.jcr.spi.index.provider.IndexChangeAdapter.completeWorkspaceChanges(IndexChangeAdapter.java:104) ~[dsdk-launcher.jar:na]
        at org.modeshape.jcr.cache.change.ChangeSetAdapter.notify(ChangeSetAdapter.java:157) ~[dsdk-launcher.jar:na]
        at org.modeshape.jcr.spi.index.provider.IndexProvider$AtomicIndex.notify(IndexProvider.java:1493) ~[dsdk-launcher.jar:na]
        at org.modeshape.jcr.bus.RepositoryChangeBus.notify(RepositoryChangeBus.java:190) ~[dsdk-launcher.jar:na]
        at org.modeshape.jcr.cache.document.WorkspaceCache.changed(WorkspaceCache.java:333) ~[dsdk-launcher.jar:na]
        at org.modeshape.jcr.txn.SynchronizedTransactions.updateCache(SynchronizedTransactions.java:223) ~[dsdk-launcher.jar:na]
        at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:751) ~[dsdk-launcher.jar:na]
        at org.modeshape.jcr.JcrSession.save(JcrSession.java:1171) ~[dsdk-launcher.jar:na]
        ... 19 common frames omitted
      Caused by: java.nio.file.FileSystemException: C:\Users\Christopher\Infiltrea3CLOUDTEST8\christopher@dooapp.com\indexes\default\nodesByPath\_dc_Lucene50_0.doc: The process cannot access the file because it is being used by another process.
        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) ~[na:1.8.0_92]
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) ~[na:1.8.0_92]
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) ~[na:1.8.0_92]
        at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(WindowsFileSystemProvider.java:115) ~[na:1.8.0_92]
        at java.nio.channels.FileChannel.open(FileChannel.java:287) ~[na:1.8.0_92]
        at java.nio.channels.FileChannel.open(FileChannel.java:335) ~[na:1.8.0_92]
        at org.apache.lucene.util.IOUtils.fsync(IOUtils.java:393) ~[dsdk-launcher.jar:na]
        at org.apache.lucene.store.FSDirectory.fsync(FSDirectory.java:281) ~[dsdk-launcher.jar:na]
        at org.apache.lucene.store.FSDirectory.sync(FSDirectory.java:226) ~[dsdk-launcher.jar:na]
        at org.apache.lucene.store.LockValidatingDirectoryWrapper.sync(LockValidatingDirectoryWrapper.java:62) ~[dsdk-launcher.jar:na]
        at org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:4456) ~[dsdk-launcher.jar:na]
        at org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:2874) ~[dsdk-launcher.jar:na]
        at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:2977) ~[dsdk-launcher.jar:na]
        at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:2944) ~[dsdk-launcher.jar:na]
        at org.modeshape.jcr.index.lucene.LuceneIndex.commit(LuceneIndex.java:152) ~[dsdk-launcher.jar:na]
        ... 27 common frames omitted