Mapdb exception after unregistering index
amischler Sep 17, 2016 8:47 AMHi,
We have published a new version of your application which unregisters an unused index from Modeshape configuration. The index has been removed from the Modeshape json configuration file. It seems that is was not sufficient to unregister this index on the repositories for which the index had been previously registered so we also execute the following command on repository startup :
((Workspace) session.getWorkspace()).getIndexManager().unregisterIndexes("nodesByUUID")
For some users, the index wen't then corrupted and all save operations in the repository fail with the following exception :
Caused by: java.lang.ClassCastException: org.mapdb.HTreeMap$LinkedNode cannot be cast to java.lang.Long
at org.mapdb.Atomic$Long.get(Atomic.java:315) ~[dsdk-launcher.jar:na]
at org.mapdb.Atomic$Long.incrementAndGet(Atomic.java:406) ~[dsdk-launcher.jar:na]
at org.mapdb.Bind$1.update(Bind.java:146) ~[dsdk-launcher.jar:na]
at org.mapdb.BTreeMap.notify(BTreeMap.java:2793) ~[dsdk-launcher.jar:na]
at org.mapdb.BTreeMap.put2(BTreeMap.java:755) ~[dsdk-launcher.jar:na]
at org.mapdb.BTreeMap.put(BTreeMap.java:643) ~[dsdk-launcher.jar:na]
at org.modeshape.jcr.index.local.LocalDuplicateIndex.add(LocalDuplicateIndex.java:91) ~[dsdk-launcher.jar:na]
at org.modeshape.jcr.spi.index.provider.IndexChangeAdapters$PropertyChangeAdapter.addValues(IndexChangeAdapters.java:694) ~[dsdk-launcher.jar:na]
at org.modeshape.jcr.spi.index.provider.IndexChangeAdapters$AbstractPropertyChangeAdapter.modifyProperties(IndexChangeAdapters.java:651) ~[dsdk-launcher.jar:na]
at org.modeshape.jcr.cache.change.ChangeSetAdapter.firePropertyChanges(ChangeSetAdapter.java:228) ~[dsdk-launcher.jar:na]
at org.modeshape.jcr.cache.change.ChangeSetAdapter.notify(ChangeSetAdapter.java:154) ~[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]
... 17 common frames omitted
This does not happened for all of our users. Any idea where this error could come from ? Is this the correct way to unregister an index ?
Note that we are using Modeshape 4.6.0.Final.
Thanks for any help.
--
Antoine