I have a deadlocked app and I am not sure how to interpret the jstack output. jstack output is shown below.
It looks to me that in each case it is the auto-locking that is causing the problem. i.e. I am not manually locking or unlocking. The most complicated thread is WorkerThread5 which is initiating a fetch to resolve a KVC lookup to perform an aggregated function with a qualifier and so attempting a lock.
Is there anything else I can do to either work out where the problem lies or solve it?
"Thread-5":
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000f60726a0> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:209)
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:285)
at com.webobjects.eocontrol.EOEditingContext.lock(EOEditingContext.java:4617)
at er.extensions.eof.ERXEC.lock(ERXEC.java:571)
at er.extensions.eof.ERXEC.autoLock(ERXEC.java:703)
at er.extensions.eof.ERXEC.globalIDForObject(ERXEC.java:932)
at com.webobjects.eoaccess.EODatabaseContext._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2370)
at com.webobjects.eoaccess.EOAccessDeferredFaultHandler.createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49)
at com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1279)
at er.extensions.eof.ERXGenericRecord.willReadRelationship(ERXGenericRecord.java:380)
at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614)
at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634)
at er.extensions.eof.ERXDatabaseContextDelegate.batchFetchToManyFault(ERXDatabaseContextDelegate.java:654)
at er.extensions.eof.ERXDatabaseContextDelegate.databaseContextShouldFetchArrayFault(ERXDatabaseContextDelegate.java:391)
at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
at com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223)
at com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:163)
at com.webobjects.eoaccess.EODatabaseContext._fireArrayFault(EODatabaseContext.java:4236)
at com.webobjects.eoaccess.EOAccessArrayFaultHandler.completeInitializationOfObject(EOAccessArrayFaultHandler.java:77)
at com.webobjects.eocontrol._EOCheapCopyMutableArray.willRead(_EOCheapCopyMutableArray.java:39)
at com.webobjects.eocontrol._EOCheapCopyMutableArray.count(_EOCheapCopyMutableArray.java:99)
at com.webobjects.foundation.NSArray.containsObject(NSArray.java:460)
at com.webobjects.eocontrol.EOCustomObject.includeObjectIntoPropertyWithKey(EOCustomObject.java:904)
at er.extensions.eof.ERXGenericRecord.includeObjectIntoPropertyWithKey(ERXGenericRecord.java:1234)
at com.eldrix.rsdb.model._Report.addToPublishedReports(_Report.java:319)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
at com.webobjects.eocontrol.EOCustomObject.addObjectToPropertyWithKey(EOCustomObject.java:940)
at com.webobjects.eocontrol.EOCustomObject.addObjectToBothSidesOfRelationshipWithKey(EOCustomObject.java:1028)
at er.extensions.eof.ERXGenericRecord.addObjectToBothSidesOfRelationshipWithKey(ERXGenericRecord.java:584)
at com.eldrix.rsdb.model._Report.createPublishedReportsRelationship(_Report.java:354)
at com.eldrix.news.controllers.ReportController$ReportPublisher.run(ReportController.java:212)
at java.lang.Thread.run(Thread.java:745)
=======
"WorkerThread5":
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000ec9b7b48> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:209)
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:285)
at com.webobjects.eocontrol.EOObjectStoreCoordinator.lock(EOObjectStoreCoordinator.java:420)
at com.webobjects.eoaccess.EODatabaseContext.registeredDatabaseContextForModel(EODatabaseContext.java:999)
at com.webobjects.eoaccess.EODatabaseContext.registeredDatabaseContextForModel(EODatabaseContext.java:1033)
at er.extensions.eof.ERXEOControlUtilities._aggregateFunctionWithQualifierAndAggregateAttribute(ERXEOControlUtilities.java:862)
at er.extensions.eof.ERXEOControlUtilities.objectCountWithQualifier(ERXEOControlUtilities.java:732)
at com.eldrix.rsdb.model.User.numberOfUnreadMessages(User.java:342)
at com.eldrix.rsdb.model.User.hasUnreadMessages(User.java:325)
at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636)
at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134)
at com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1498)
at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447)
at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
at com.webobjects.eocontrol.EOCustomObject.valueForKeyPath(EOCustomObject.java:1588)
at com.webobjects.foundation.NSKeyValueCodingAdditions$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:149)
at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:217)
at com.webobjects.appserver.WOSession.valueForKeyPath(WOSession.java:1780)
at com.webobjects.foundation.NSKeyValueCodingAdditions$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:149)
at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:217)
at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804)
at er.extensions.appserver.navigation.ERXNavigationMenuItem.resolveValue(ERXNavigationMenuItem.java:222)
at er.extensions.appserver.navigation.ERXNavigationMenuItem.hasActivity(ERXNavigationMenuItem.java:229)
at er.extensions.appserver.navigation.ERXNavigationMenuItem.hasActivityAndIsEnabled(ERXNavigationMenuItem.java:235)
at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636)
at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134)
at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324)
at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736)
at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447)
at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804)
at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50)
at com.webobjects.appserver.WOAssociation.booleanValueInComponent(WOAssociation.java:276)
at com.webobjects.appserver._private.WOConditional.evaluateCondition(WOConditional.java:60)
at com.webobjects.appserver._private.WOConditional.invokeAction(WOConditional.java:85)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver._private.WOConditional.invokeAction(WOConditional.java:86)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WOGenericContainer.invokeAction(WOGenericContainer.java:29)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver._private.WOConditional.invokeAction(WOConditional.java:86)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:168)
at er.extensions.components.ERXNonSynchronizingComponent.invokeAction(ERXNonSynchronizingComponent.java:66)
at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at er.extensions.components._private.ERXWORepetition.invokeAction(ERXWORepetition.java:547)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WOGenericContainer.invokeAction(WOGenericContainer.java:29)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver._private.WOConditional.invokeAction(WOConditional.java:86)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:168)
at er.extensions.components.ERXNonSynchronizingComponent.invokeAction(ERXNonSynchronizingComponent.java:66)
at er.extensions.appserver.navigation.ERXNavigationMenu.invokeAction(ERXNavigationMenu.java:150)
at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:168)
at er.extensions.components.ERXNonSynchronizingComponent.invokeAction(ERXNonSynchronizingComponent.java:66)
at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at er.extensions.components.conditionals.ERXWOConditional.invokeChildrenAction(ERXWOConditional.java:116)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at er.extensions.components.conditionals.ERXWOConditional.invokeAction(ERXWOConditional.java:108)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:168)
at er.extensions.components.ERXNonSynchronizingComponent.invokeAction(ERXNonSynchronizingComponent.java:66)
at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:168)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357)
at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1745)
at er.extensions.appserver.ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:119)
at er.extensions.appserver.ERXApplication.invokeAction(ERXApplication.java:2006)
at er.ajax.AjaxResponse.generateResponse(AjaxResponse.java:67)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:229)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:298)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:332)
at com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:369)
at com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:445)
at er.ajax.AjaxRequestHandler.handleRequest(AjaxRequestHandler.java:20)
at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:2127)
at er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:2092)
at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:745)
Found 1 deadlock.