Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Deadlock detected
Deadlock detected [message #739716] Mon, 17 October 2011 19:36 Go to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre BergaminFriend
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Dear virgo users
We get a "Deadlock detected" error message when starting our plan:

[2011-10-17 21:26:27.903] start-signalling-2 <DE0005I> Started bundle 'com.example.foo' version '0.0.1.BUILD-SNAPSHOT'.
...
[2011-10-17 21:26:45.174] start-signalling-2 <WE0001I> Started web bundle 'com.example.web' version '0.0.1.BUILD-SNAPSHOT' with context path '/er'.
[2011-10-17 21:26:45.175] start-signalling-2 <DE0005I> Started bundle 'com.example.web' version '0.0.1.BUILD-SNAPSHOT'.
[2011-10-17 21:26:46.775] deadlock-monitor-thread-1 <CC0000E> Deadlock detected. Generating dump.
[2011-10-17 21:26:57.297] deadlock-monitor-thread-1 <ME0003I> Dump 'serviceability/dump/2011-10-17-21-26-776' generated

Is this deadlock a bug in virgo or some problem in our bundles?


Best regards,
James
Re: Deadlock detected [message #740088 is a reply to message #739716] Tue, 18 October 2011 06:24 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Take a look inside the thread stack dump which was generated and see which threads are waiting for each other in a deadly embrace. You'll easily be able to see which stack frames are holding the relevant locks and whether these stack frames belong to Virgo, the application, or some other dependency.
Re: Deadlock detected [message #740103 is a reply to message #740088] Tue, 18 October 2011 06:49 Go to previous messageGo to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre BergaminFriend
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Good morning Glyn

Thanks for your answer.
The deadlock occurs during spring application initialization. We have two bundles that have an ApplicationListener configured to listen to ContextRefreshedEvent events as:
public class Listener implements ApplicationListener<ContextRefreshedEvent> { ... }


One of the two bundles with such a listener uses a registered service of bundle 1 in the onApplicationEvent() method of the listener.
When I remove one of those bundles from the plan, all others start ok. Any ideas how to overcome this? Rolling Eyes


Best regards,
James



Deadlocked Threads
==================

"region-dm-11" Id=77 BLOCKED on java.util.concurrent.ConcurrentHashMap@196a6469 owned by "region-dm-7" Id=67
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinitionNames(DefaultListableBeanFactory.java:288)
- blocked on java.util.concurrent.ConcurrentHashMap@196a6469
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:305)
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:185)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:833)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
...

Number of locked synchronizers = 2
- java.util.concurrent.locks.ReentrantLock$NonfairSync@51f6f0d2
- java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync@2b3c9508


"region-dm-7" Id=67 BLOCKED on java.util.concurrent.ConcurrentHashMap@17e63688 owned by "region-dm-11" Id=77
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:180)
- blocked on java.util.concurrent.ConcurrentHashMap@17e63688
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:881)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:566)
- locked java.util.concurrent.ConcurrentHashMap@196a6469
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
- locked java.lang.Object@165c5665
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
...

Number of locked synchronizers = 1
- java.util.concurrent.locks.ReentrantLock$NonfairSync@82c0c5b
Re: Deadlock detected [message #740141 is a reply to message #740103] Tue, 18 October 2011 07:48 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
On the face of it, this looks like a deadlock in Spring framework. Unfortunately, I can't see the stack frame in region-dm-11 which is holding java.util.concurrent.ConcurrentHashMap@17e63688 and that would be handy so we can pinpoint the deadlocking code.

Please can you post the full stack of region-dm-11.
Re: Deadlock detected [message #740194 is a reply to message #740141] Tue, 18 October 2011 08:50 Go to previous messageGo to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre BergaminFriend
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Here are the stacktraces of the two regions that block each other:

region-dm-11


"region-dm-11" prio=5 tid=77 BLOCKED
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinitionNames(DefaultListableBeanFactory.java:288)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:305)
Local Variable: java.util.ArrayList#29140
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:185)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:833)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
Local Variable: class net.junisphere.eranger.service.ICollectorRepository
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)
Local Variable: org.springframework.beans.factory.config.DependencyDescriptor#6
Local Variable: java.util.LinkedHashSet#3104
Local Variable: org.springframework.beans.SimpleTypeConverter#1
Local Variable: java.lang.reflect.Field#1407
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
Local Variable: java.util.LinkedHashMap$KeyIterator#1
Local Variable: org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement#90
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
Local Variable: org.springframework.beans.factory.annotation.InjectionMetadata#558
Local Variable: org.springframework.beans.MutablePropertyValues#761
Local Variable: org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor#7
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
Local Variable: java.util.AbstractList$Itr#3
Local Variable: java.beans.PropertyDescriptor[]#583
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
Local Variable: org.springframework.beans.BeanWrapperImpl#1
Local Variable: class net.junisphere.eranger.domain.internal.neo4j.repositories.DbInitialization
Local Variable: net.junisphere.eranger.domain.internal.neo4j.repositories.DbInitialization#1
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
Local Variable: org.springframework.beans.factory.support.AbstractBeanFactory$1#1
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
Local Variable: org.springframework.beans.factory.support.RootBeanDefinition#435
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
Local Variable: class org.springframework.context.ApplicationListener
at org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:148)
Local Variable: java.util.LinkedList#2740
Local Variable: java.util.LinkedHashMap$KeyIterator#2
Local Variable: java.lang.String#128212
Local Variable: class org.springframework.data.mapping.event.MappingContextEvent
Local Variable: org.springframework.context.event.AbstractApplicationEventMulticaster$ListenerRetriever#43
Local Variable: org.springframework.context.event.AbstractApplicationEventMulticaster$ListenerCacheKey#31
Local Variable: org.springframework.context.event.AbstractApplicationEventMulticaster$ListenerRetriever#50
Local Variable: class org.springframework.data.neo4j.mapping.Neo4JPersistentEntityImpl
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:86)
Local Variable: org.springframework.context.event.SimpleApplicationEventMulticaster#17
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
Local Variable: org.springframework.data.mapping.event.MappingContextEvent#1
at org.springframework.data.mapping.context.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:256)
Local Variable: org.springframework.data.neo4j.mapping.Neo4JPersistentEntityImpl#2
Local Variable: java.util.HashMap#48856
Local Variable: java.beans.GenericBeanInfo#279
Local Variable: java.beans.PropertyDescriptor[]#458
Local Variable: class net.junisphere.eranger.domain.model.IPropertyValue
at org.springframework.data.mapping.context.AbstractMappingContext$PersistentPropertyCreator.doWith(AbstractMappingContext.java:395)
Local Variable: org.springframework.data.neo4j.mapping.Neo4JPersistentPropertyImpl#1
Local Variable: org.springframework.data.util.ClassTypeInformation#107
Local Variable: java.beans.PropertyDescriptor#2172
at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513)
Local Variable: org.springframework.data.mapping.context.AbstractMappingContext$1#1
Local Variable: org.springframework.data.mapping.context.AbstractMappingContext$PersistentPropertyCreator#1
Local Variable: java.lang.reflect.Field[]#96
Local Variable: class net.junisphere.eranger.domain.model.neo4j.base.Entity
Local Variable: java.lang.reflect.Field#1385
at org.springframework.data.mapping.context.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:246)
Local Variable: java.util.HashMap#48857
Local Variable: java.beans.GenericBeanInfo#274
Local Variable: org.springframework.data.neo4j.mapping.Neo4JPersistentEntityImpl#1
Local Variable: java.beans.PropertyDescriptor[]#453
at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:165)
Local Variable: org.springframework.data.util.ClassTypeInformation#104
at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:140)
Local Variable: org.springframework.data.neo4j.mapping.Neo4JMappingContext#1
at org.springframework.data.neo4j.support.node.NodeEntityStateFactory.getEntityState(NodeEntityStateFactory.java:48)
Local Variable: $Proxy310#1
Local Variable: org.springframework.data.neo4j.support.node.NodeEntityStateFactory#1
at org.springframework.data.neo4j.support.node.Neo4jNodeBacking.ajc$before$org_springframework_data_neo4j_support_node_Neo4jNodeBacking$1$74591ff9(Neo4jNodeBacking.aj:127)
Local Variable: org.springframework.data.neo4j.support.node.Neo4jNodeBacking#1
at net.junisphere.eranger.domain.model.neo4j.base.BaseEntity.<init>(BaseEntity.java:19)
at net.junisphere.eranger.domain.model.neo4j.base.Entity.<init>(Entity.java:24)
at net.junisphere.eranger.domain.model.neo4j.base.NamedEntity.<init>(NamedEntity.java:17)
at net.junisphere.eranger.domain.model.neo4j.Server.<init>(Server.java:9)
Local Variable: net.junisphere.eranger.domain.model.neo4j.Server#1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
Local Variable: java.lang.Object[]#34564
Local Variable: sun.reflect.NativeConstructorAccessorImpl#570
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.data.persistence.AbstractConstructorEntityInstantiator$2.create(AbstractConstructorEntityInstantiator.java:89)
at org.springframework.data.persistence.AbstractConstructorEntityInstantiator.createEntityFromState(AbstractConstructorEntityInstantiator.java:36)
Local Variable: class org.neo4j.kernel.impl.core.NodeProxy
Local Variable: org.springframework.data.persistence.AbstractConstructorEntityInstantiator$2#6
Local Variable: java.util.HashMap#45951
Local Variable: org.springframework.data.neo4j.support.node.NodeEntityInstantiator#1
at org.springframework.data.neo4j.support.typerepresentation.IndexingNodeTypeRepresentationStrategy.createEntity(IndexingNodeTypeRepresentationStrategy.java:123)
at org.springframework.data.neo4j.support.typerepresentation.IndexingNodeTypeRepresentationStrategy.createEntity(IndexingNodeTypeRepresentationStrategy.java:1)
Local Variable: org.springframework.data.neo4j.support.typerepresentation.IndexingNodeTypeRepresentationStrategy#1
at org.springframework.data.neo4j.support.GraphDatabaseContext.createEntityFromState(GraphDatabaseContext.java:111)
Local Variable: class net.junisphere.eranger.domain.model.neo4j.Server
Local Variable: org.springframework.data.neo4j.support.GraphDatabaseContext#1
at org.springframework.data.neo4j.repository.AbstractGraphRepository.createEntity(AbstractGraphRepository.java:142)
at org.springframework.data.neo4j.repository.AbstractGraphRepository.findByPropertyValue(AbstractGraphRepository.java:122)
Local Variable: org.neo4j.kernel.impl.core.NodeProxy#8
at org.springframework.data.neo4j.repository.AbstractGraphRepository.findByPropertyValue(AbstractGraphRepository.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Local Variable: sun.reflect.NativeMethodAccessorImpl#318
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:322)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:307)
Local Variable: java.lang.reflect.Method#12537
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
Local Variable: org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor#22
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
Local Variable: org.springframework.transaction.interceptor.TransactionAspectSupport$TransactionInfo#1
Local Variable: java.lang.String#127379
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
Local Variable: org.springframework.transaction.interceptor.TransactionInterceptor#22
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
Local Variable: org.springframework.dao.support.PersistenceExceptionTranslationInterceptor#22
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
Local Variable: java.lang.Object[]#34563
Local Variable: java.util.ArrayList#25924
Local Variable: org.springframework.aop.framework.ReflectiveMethodInvocation#1
Local Variable: org.springframework.aop.framework.JdkDynamicAopProxy#55
Local Variable: org.springframework.aop.target.SingletonTargetSource#22
Local Variable: org.springframework.data.neo4j.repository.NodeGraphRepository#9
Local Variable: class org.springframework.data.neo4j.repository.NodeGraphRepository
Local Variable: java.lang.reflect.Method#12535
at $Proxy320.findByPropertyValue(<unknown string>)
Local Variable: $Proxy320#1
Local Variable: java.lang.String#168321
at net.junisphere.eranger.domain.internal.neo4j.repositories.AbstractBaseRepository.findByUuid(AbstractBaseRepository.java:168)
at net.junisphere.eranger.domain.internal.neo4j.repositories.AbstractBaseRepository.findByUuid(AbstractBaseRepository.java:1)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Local Variable: sun.reflect.NativeMethodAccessorImpl#402
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
Local Variable: net.junisphere.eranger.domain.internal.neo4j.repositories.ServerRepository#1
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
Local Variable: org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor#47
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
Local Variable: org.springframework.osgi.service.importer.support.internal.aop.InfrastructureOsgiProxyAdvice#53
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
Local Variable: org.springframework.osgi.service.importer.support.LocalBundleContextAdvice#49
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
Local Variable: org.springframework.osgi.service.importer.support.internal.aop.ImportedOsgiServiceProxyAdvice#53
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
Local Variable: java.lang.Object[]#34562
Local Variable: org.springframework.aop.framework.ReflectiveMethodInvocation#2
Local Variable: org.springframework.aop.framework.JdkDynamicAopProxy#80
Local Variable: java.lang.reflect.Method#18045
Local Variable: java.util.ArrayList#29030
Local Variable: org.springframework.aop.target.EmptyTargetSource#1
at $Proxy325.findByUuid(<unknown string>)
Local Variable: $Proxy325#1
Local Variable: java.lang.String#125833
at net.junisphere.eranger.server.core.internal.setup.ServerSetupHandler.setup(ServerSetupHandler.java:32)
at net.junisphere.eranger.server.core.internal.setup.Setup.setup(Setup.java:15)
Local Variable: net.junisphere.eranger.server.core.internal.setup.Setup#1
Local Variable: net.junisphere.eranger.server.core.internal.setup.ServerSetupHandler#1
Local Variable: java.util.AbstractList$Itr#4
at net.junisphere.eranger.server.core.internal.ServerCore.onApplicationEvent(ServerCore.java:23)
at net.junisphere.eranger.server.core.internal.ServerCore.onApplicationEvent(ServerCore.java:12)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
Local Variable: org.springframework.context.event.SimpleApplicationEventMulticaster#19
Local Variable: net.junisphere.eranger.server.core.internal.ServerCore#1
Local Variable: java.util.LinkedList$ListItr#6
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
Local Variable: org.springframework.context.event.ContextRefreshedEvent#1
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
Local Variable: java.lang.Object#37133
Local Variable: org.springframework.beans.factory.support.DefaultListableBeanFactory#14
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
Local Variable: org.springframework.osgi.util.BundleDelegatingClassLoader#60
Local Variable: org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4#1
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
Local Variable: org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext#12
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
Local Variable: java.lang.Object#35072
Local Variable: org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask#1
at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
Local Variable: org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader#95
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
Local Variable: java.util.concurrent.locks.ReentrantLock#226
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
Local Variable: java.util.concurrent.ThreadPoolExecutor$Worker#25
Local Variable: org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2#1
at java.lang.Thread.run(Thread.java:662)



region-dm-7




"region-dm-7" prio=5 tid=67 BLOCKED
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:180)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:881)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:566)
Local Variable: java.util.ArrayList#29141
Local Variable: java.util.AbstractList$Itr#5
Local Variable: org.springframework.beans.factory.support.RootBeanDefinition#485
Local Variable: java.lang.String#110627
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
Local Variable: java.lang.Object#36169
Local Variable: org.springframework.beans.factory.support.DefaultListableBeanFactory#12
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
Local Variable: org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4#2
Local Variable: org.springframework.osgi.util.BundleDelegatingClassLoader#58
Local Variable: org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader#146
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
Local Variable: org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext#9
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
Local Variable: org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask#2
Local Variable: java.lang.Object#36168
at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
Local Variable: org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader#21
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
Local Variable: java.util.concurrent.locks.ReentrantLock#102
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
Local Variable: org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2#2
Local Variable: java.util.concurrent.ThreadPoolExecutor$Worker#21
at java.lang.Thread.run(Thread.java:662)
Re: Deadlock detected [message #740265 is a reply to message #740194] Tue, 18 October 2011 10:22 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Thanks. Please would you raise a bug against Spring and the Spring team will look into it. If a fix is necessary, it could possibly go into 3.1 RC2 and/or 3.0.7.
Re: Deadlock detected [message #740366 is a reply to message #740265] Tue, 18 October 2011 12:35 Go to previous messageGo to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre BergaminFriend
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Thanks Glyn

I created SPR-8785.


Best regards,
James
Re: Deadlock detected [message #740372 is a reply to message #740366] Tue, 18 October 2011 12:43 Go to previous messageGo to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre BergaminFriend
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Is there a way to configure virgo so that the bundles are loaded one by one instead of simultaneously?
When starting virgo withing eclipse, this is the case anyway.
Re: Deadlock detected [message #752006 is a reply to message #740372] Wed, 26 October 2011 08:34 Go to previous messageGo to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre BergaminFriend
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Any chance for a workaround until this bug is fixed in a future spring release?
Re: Deadlock detected [message #814401 is a reply to message #752006] Tue, 06 March 2012 11:58 Go to previous messageGo to next message
eugene rabii is currently offline eugene rabiiFriend
Messages: 13
Registered: February 2012
Junior Member
+1 I am too getting it. Did you have a workaround for it?

Thank You, Eugene.
Re: Deadlock detected [message #821054 is a reply to message #814401] Wed, 14 March 2012 22:01 Go to previous messageGo to next message
Jeff Schenk is currently offline Jeff SchenkFriend
Messages: 2
Registered: March 2012
Junior Member
I am getting this Block as well, during running surefire testsuite against framework.

org.springframework.context.event.AbstractApplicationEventMulticaster

Name: main
State: BLOCKED on org.springframework.context.event.AbstractApplicationEventMulticaster$ListenerRetriever@11cba35a

tack trace:
org.springframework.context.event.AbstractApplicationEventMulticaster.addApplicationListener(AbstractApplicationEventMulticaster.java:63)
org.springframework.context.support.AbstractApplicationContext.addApplicationListener(AbstractApplicationContext.java:376)
org.springframework.context.support.AbstractApplicationContext$ApplicationListenerDetector.postProcessAfterInitialization(AbstractApplicationContext.java:1366)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
- locked java.util.concurrent.ConcurrentHashMap@6351149e
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
- locked java.util.concurrent.ConcurrentHashMap@8a1a5ba
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
- locked java.lang.Object@2c875ac3
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)
org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)
- locked org.springframework.test.context.ContextCache@6a57cf0b
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
org.junit.runners.ParentRunner.run(ParentRunner.java:236)
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
org.apache.maven.surefire.Surefire.run(Surefire.java:180)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Re: Deadlock detected [message #821072 is a reply to message #821054] Wed, 14 March 2012 22:34 Go to previous messageGo to next message
Jeff Schenk is currently offline Jeff SchenkFriend
Messages: 2
Registered: March 2012
Junior Member
A Work around was to place a sleep in a child thread established prior to firing an event at startup to ensure spring event framework has been established.
At least this was my case.
Jeff
Re: Deadlock detected [message #822179 is a reply to message #740372] Fri, 16 March 2012 09:02 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Jean-Pierre Bergamin wrote on Tue, 18 October 2011 13:43
Is there a way to configure virgo so that the bundles are loaded one by one instead of simultaneously?
When starting virgo withing eclipse, this is the case anyway.


Sorry for the delay in replying - I somehow got unsubscribed from this thread.

The answer is not really. Spring DM introduces plenty of concurrency with its worker threads building application contexts even when bundles are started one by one.

The only workaround would appear to be to patch Spring and then replace the instance of Spring in the User Region as per the FAQ. Unfortunately, the issue SPR-8471 which is tracking the Spring bug doesn't appear to be fixed yet, so I'm not sure how hard a patch would be to create.
Previous Topic:Adding a custom command via gogo in Virgo 3
Next Topic:Virgo tomcat web server OutOfMemoryError
Goto Forum:
  


Current Time: Thu Nov 27 02:04:30 GMT 2014

Powered by FUDForum. Page generated in 0.02918 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software