Running FixSongs immediately before cache checked can cause contention issue

Description

Running FixSongs immediately before cache checked can cause contention issue

java.lang.ExceptionInInitializerError
at com.jthink.songkong.cmdline.SongKong.checkCache(SongKong.java:1699)
at com.jthink.songkong.cmdline.SongKong.guiStart(SongKong.java:1478)
at com.jthink.songkong.cmdline.SongKong.finish(SongKong.java:1541)
at com.jthink.songkong.cmdline.SongKong.main(SongKong.java:1566)
Caused by: java.lang.RuntimeException: Unable to create SongKong Cache Managerersistence directory already locked by this process: C:\Users\Paul\AppData\Roaming\SongKong\Database\EhCache
at com.jthink.songkong.cache.SongKongCacheManager.createCacheManager(SongKongCacheManager.java:46)
at com.jthink.songkong.cache.SongKongCacheManager.getCacheManager(SongKongCacheManager.java:66)
at com.jthink.songkong.cache.AlbunackCache.createCache(AlbunackCache.java:51)
at com.jthink.songkong.cache.AlbunackCache.<init>(AlbunackCache.java:65)
at com.jthink.songkong.cache.DiscogsReleaseCache.<init>(DiscogsReleaseCache.java:32)
at com.jthink.songkong.cache.DiscogsReleaseCache.<clinit>(DiscogsReleaseCache.java:27)
... 4 more
Caused by: org.ehcache.StateTransitionException: Persistence directory already locked by this process: C:\Users\Paul\AppData\Roaming\SongKong\Database\EhCache
at org.ehcache.core.StatusTransitioner$Transition.failed(StatusTransitioner.java:235)
at org.ehcache.core.EhcacheManager.init(EhcacheManager.java:621)
at com.jthink.songkong.cache.SongKongCacheManager.createCacheManager(SongKongCacheManager.java:42)
... 9 more
Caused by: java.lang.RuntimeException: Persistence directory already locked by this process: C:\Users\Paul\AppData\Roaming\SongKong\Database\EhCache
at org.ehcache.impl.persistence.DefaultLocalPersistenceService.internalStart(DefaultLocalPersistenceService.java:95)
at org.ehcache.impl.persistence.DefaultLocalPersistenceService.start(DefaultLocalPersistenceService.java:75)
at org.ehcache.core.spi.ServiceLocator.startAllServices(ServiceLocator.java:128)
at org.ehcache.core.EhcacheManager.init(EhcacheManager.java:593)
... 10 more
Caused by: java.nio.channels.OverlappingFileLockException
at java.base/sun.nio.ch.SharedFileLockTable.checkList(Unknown Source)
at java.base/sun.nio.ch.SharedFileLockTable.add(Unknown Source)
at java.base/sun.nio.ch.FileChannelImpl.tryLock(Unknown Source)
at java.base/java.nio.channels.FileChannel.tryLock(Unknown Source)
at org.ehcache.impl.persistence.DefaultLocalPersistenceService.internalStart(DefaultLocalPersistenceService.java:93)
... 13 more
java.lang.ExceptionInInitializerError
at com.jthink.songkong.cmdline.SongKong.checkCache(SongKong.java:1699)
at com.jthink.songkong.cmdline.SongKong.guiStart(SongKong.java:1478)
at com.jthink.songkong.cmdline.SongKong.finish(SongKong.java:1541)
at com.jthink.songkong.cmdline.SongKong.main(SongKong.java:1566)
Caused by: java.lang.RuntimeException: Unable to create SongKong Cache Managerersistence directory already locked by this process: C:\Users\Paul\AppData\Roaming\SongKong\Database\EhCache
at com.jthink.songkong.cache.SongKongCacheManager.createCacheManager(SongKongCacheManager.java:46)
at com.jthink.songkong.cache.SongKongCacheManager.getCacheManager(SongKongCacheManager.java:66)
at com.jthink.songkong.cache.AlbunackCache.createCache(AlbunackCache.java:51)
at com.jthink.songkong.cache.AlbunackCache.<init>(AlbunackCache.java:65)
at com.jthink.songkong.cache.DiscogsReleaseCache.<init>(DiscogsReleaseCache.java:32)
at com.jthink.songkong.cache.DiscogsReleaseCache.<clinit>(DiscogsReleaseCache.java:27)
... 4 more
Caused by: org.ehcache.StateTransitionException: Persistence directory already locked by this process: C:\Users\Paul\AppData\Roaming\SongKong\Database\EhCache
at org.ehcache.core.StatusTransitioner$Transition.failed(StatusTransitioner.java:235)
at org.ehcache.core.EhcacheManager.init(EhcacheManager.java:621)
at com.jthink.songkong.cache.SongKongCacheManager.createCacheManager(SongKongCacheManager.java:42)
... 9 more
Caused by: java.lang.RuntimeException: Persistence directory already locked by this process: C:\Users\Paul\AppData\Roaming\SongKong\Database\EhCache
at org.ehcache.impl.persistence.DefaultLocalPersistenceService.internalStart(DefaultLocalPersistenceService.java:95)
at org.ehcache.impl.persistence.DefaultLocalPersistenceService.start(DefaultLocalPersistenceService.java:75)
at org.ehcache.core.spi.ServiceLocator.startAllServices(ServiceLocator.java:128)
at org.ehcache.core.EhcacheManager.init(EhcacheManager.java:593)
... 10 more
Caused by: java.nio.channels.OverlappingFileLockException
at java.base/sun.nio.ch.SharedFileLockTable.checkList(Unknown Source)
at java.base/sun.nio.ch.SharedFileLockTable.add(Unknown Source)
at java.base/sun.nio.ch.FileChannelImpl.tryLock(Unknown Source)
at java.base/java.nio.channels.FileChannel.tryLock(Unknown Source)
at org.ehcache.impl.persistence.DefaultLocalPersistenceService.internalStart(DefaultLocalPersistenceService.java:93)
... 13 more
25/06/2019 11.59.14:BST:CmdLogger:log:SEVERE: An unexpected error has occurred on thread main, please report to support @jthink.net

25/06/2019 11.59.15:BST:FixSongs:doInBackground:SEVERE: Could not initialize class com.jthink.songkong.cache.DiscogsReleaseCache
java.lang.NoClassDefFoundError: Could not initialize class com.jthink.songkong.cache.DiscogsReleaseCache
at com.jthink.songkong.analyse.toplevelanalyzer.FixSongsController.reset(FixSongsController.java:162)
at com.jthink.songkong.analyse.toplevelanalyzer.FixSongsController.start(FixSongsController.java:178)
at com.jthink.songkong.ui.swingworker.FixSongs.doInBackground(FixSongs.java:49)
at com.jthink.songkong.ui.swingworker.FixSongs.doInBackground(FixSongs.java:18)
at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.desktop/javax.swing.SwingWorker.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
25/06/2019 11.59.15:BSTrogressDialog:close:WARNING: Close Progress Dialog
25/06/2019 11.59.15:BST:FixSongs:done:SEVERE: null
java.lang.NullPointerException
at com.jthink.songkong.ui.ShowFixSongs.<init>(ShowFixSongs.java:60)
at com.jthink.songkong.ui.swingworker.FixSongs.done(FixSongs.java:75)
at java.desktop/javax.swing.SwingWorker$5.run(Unknown Source)
at java.desktop/javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
at java.desktop/sun.swing.AccumulativeRunnable.run(Unknown Source)
at java.desktop/javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at java.desktop/javax.swing.Timer.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue.access$600(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Environment

None

Status

Assignee

Unassigned

Reporter

IJabz

Labels

None

Forum Username

ijabz

os

None

Components

Fix versions

Affects versions

6.2

Priority

Major
Configure