Claus Ibsen created CAMEL-7161:
----------------------------------

             Summary: camel-dozer - Can cause dead-lock in init when using 
spring
                 Key: CAMEL-7161
                 URL: https://issues.apache.org/jira/browse/CAMEL-7161
             Project: Camel
          Issue Type: Bug
    Affects Versions: 2.12.2
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 2.12.3, 2.13.0


When using spring with dozer, and we call init in the ctr, then spring can 
cause a dead lock when it does its getBean stuff.

{code}
   java.lang.Thread.State: BLOCKED (on object monitor)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:182)
        - waiting to lock <0x00000007d7c4ca38> (a 
java.util.concurrent.ConcurrentHashMap)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:468)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:356)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:334)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:434)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:428)
        at 
org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1182)
        at 
org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:228)
        at 
org.apache.camel.spring.spi.ApplicationContextRegistry.findByTypeWithName(ApplicationContextRegistry.java:85)
        at 
org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.findByTypeWithName(PropertyPlaceholderDelegateRegistry.java:70)
        at 
org.apache.camel.converter.dozer.DozerTypeConverterLoader.lookupDozerBeanMapperConfigurations(DozerTypeConverterLoader.java:228)
        at 
org.apache.camel.converter.dozer.DozerTypeConverterLoader.init(DozerTypeConverterLoader.java:155)
{code}

We should defer init to a bit later, and turn the loader into a service so init 
is done like the others with start|stop methods.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to