Best regards,
James]]>Jean-Pierre Bergamin2011-10-17T19:36:23-00:00Re: Deadlock detectedhttps://www.eclipse.org/forums/index.php/mv/msg/248977/740088/#msg_740088
Glyn Normington2011-10-18T06:24:17-00:00Re: Deadlock detectedhttps://www.eclipse.org/forums/index.php/mv/msg/248977/740103/#msg_740103
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:

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?

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)
...

"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
]]>Jean-Pierre Bergamin2011-10-18T06:49:21-00:00Re: Deadlock detectedhttps://www.eclipse.org/forums/index.php/mv/msg/248977/740141/#msg_740141
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.]]>Glyn Normington2011-10-18T07:48:08-00:00Re: Deadlock detectedhttps://www.eclipse.org/forums/index.php/mv/msg/248977/740194/#msg_740194
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)
]]>Jean-Pierre Bergamin2011-10-18T08:50:12-00:00Re: Deadlock detectedhttps://www.eclipse.org/forums/index.php/mv/msg/248977/740265/#msg_740265
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.]]>Glyn Normington2011-10-18T10:22:24-00:00Re: Deadlock detectedhttps://www.eclipse.org/forums/index.php/mv/msg/248977/740366/#msg_740366
I created SPR-8785.

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.]]>Glyn Normington2012-03-16T09:02:19-00:00