title: Cause=slf4j dependency confiliction - NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format
body: <p>I have 2 application context which one import another(appContext-middleware -> appContext-core)</p>
  
  <p>when i test appContext-core with test case below it works fine, </p>
  
  <pre><code>@Transactional
  @RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration("/applicationContext-core.xml")
  @TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true)
  public class DaoTest {
      @Autowired
      UsersDao usersDao;
  
      @Test
      public void testUsers() throws Exception {
      Assert.assertNotNull(usersDao);   
      }
  
  }
  </code></pre>
  
  <p>and also without importing appContext-core appContext-middleware works fine too</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration("classpath:applicationContext-middleware.xml")
  public class TestSomeService {
      @Autowired
      SomeService someService;
  
      @Test
      public void getBeans() {
          Assert.assertNotNull(someService);
      }
  }
  </code></pre>
  
  <p>But when i import appContext-core inside appContext-middleware, bean initiations fail as follow</p>
  
  <pre><code>java.lang.IllegalStateException: Failed to load ApplicationContext
      at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:308)
      at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
      at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
      at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:220)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:301)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:303)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'usersDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.project.tr.some.core.dao.impl.someGenericDaoImpl.init(org.springframework.orm.hibernate3.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-core.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-core.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
      at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
      at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)
      at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)
      ... 22 more
  Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.project.tr.some.core.dao.impl.someGenericDaoImpl.init(org.springframework.orm.hibernate3.HibernateTemplate); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [applicationContext-core.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-core.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:589)
      at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
  </code></pre>
  
  <p>applicationContext-core.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:tx="http://www.springframework.org/schema/tx"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
         http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"&gt;
  
  
      &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
          &lt;property name="ignoreUnresolvablePlaceholders" value="true"/&gt;
          &lt;property name="locations"&gt;
              &lt;list&gt;
                  &lt;value&gt;classpath:/project.properties&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;context:component-scan base-package="com.project.tr.core.dao"/&gt;
  
      &lt;bean id="sessionFactory" class=
              "org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource"/&gt;
          &lt;property name="packagesToScan" value="com.project.tr.core.model"/&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="c3p0.acquire_increment"&gt;1&lt;/prop&gt;
                  &lt;prop key="c3p0.idle_test_period"&gt;120&lt;/prop&gt;
                  &lt;prop key="c3p0.max_size"&gt;5&lt;/prop&gt;
                  &lt;prop key="c3p0.max_statements"&gt;0&lt;/prop&gt;
                  &lt;prop key="c3p0.min_size"&gt;2&lt;/prop&gt;
                  &lt;prop key="c3p0.timeout"&gt;120&lt;/prop&gt;
                  &lt;prop key="hibernate.dialect"&gt;${hibernate.dialect}&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;${hibernate.show_sql}&lt;/prop&gt;
                  &lt;prop key="hibernate.bytecode.use_reflection_optimizer"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.connection.autocommit"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.jdbc.batch_size"&gt;50&lt;/prop&gt;
                  &lt;prop key="hibernate.connection.CharSet"&gt;latin5&lt;/prop&gt;
                  &lt;prop key="hibernate.connection.characterEncoding"&gt;latin5&lt;/prop&gt;
                  &lt;prop key="hibernate.connection.provider_class"&gt;org.hibernate.connection.C3P0ConnectionProvider&lt;/prop&gt;
                  &lt;prop key="hibernate.connection.url"&gt;${database.connection.url}&lt;/prop&gt;
                  &lt;prop key="hibernate.connection.driver_class"&gt;${database.connection.driver}&lt;/prop&gt;
                  &lt;prop key="hibernate.connection.username"&gt;${database.connection.username}&lt;/prop&gt;
                  &lt;prop key="hibernate.connection.password"&gt;${database.connection.password}&lt;/prop&gt;
                  &lt;prop key="hibernate.jdbc.sql_exception_converter"&gt;
                      com.project.tr.core.exception.SQLExceptionTranslator
                  &lt;/prop&gt;
                  &lt;prop key="hibernate.cache.use_second_level_cache"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.cache.use_query_cache"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.cache.region.factory_class"&gt;net.sf.ehcache.hibernate.EhCacheRegionFactory&lt;/prop&gt;
                  &lt;prop key="hibernate.generate_statistics"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.order_inserts"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.order_updates"&gt;true&lt;/prop&gt;
                  &lt;!--&lt;prop key="hibernate.hbm2ddl.auto"&gt;create&lt;/prop&gt;--&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"&gt;
          &lt;property name="driverClass"&gt;
              &lt;value&gt;${database.connection.driver}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="jdbcUrl"&gt;
              &lt;value&gt;${database.connection.url}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="user"&gt;
              &lt;value&gt;${database.connection.username}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="password"&gt;
              &lt;value&gt;${database.connection.password}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="acquireIncrement"&gt;
              &lt;value&gt;${database.connection.acquireIncrement}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="initialPoolSize"&gt;
              &lt;value&gt;${database.connection.initialPoolSize}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="maxIdleTime"&gt;
              &lt;value&gt;${database.connection.maxIdleTime}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="maxPoolSize"&gt;
              &lt;value&gt;${database.connection.maxPoolSize}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="maxStatements"&gt;
              &lt;value&gt;${database.connection.maxStatements}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="minPoolSize"&gt;
              &lt;value&gt;${database.connection.minPoolSize}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="idleConnectionTestPeriod"&gt;
              &lt;value&gt;${database.connection.idleConnectionTestPeriod}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="preferredTestQuery"&gt;
              &lt;value&gt;${database.connection.preferredTestQuery}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="maxAdministrativeTaskTime"&gt;
              &lt;value&gt;${database.connection.maxAdministrativeTaskTime}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="unreturnedConnectionTimeout"&gt;
              &lt;value&gt;${database.connection.unreturnedConnectionTimeout}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="debugUnreturnedConnectionStackTraces"&gt;
              &lt;value&gt;${database.connection.debugUnreturnedConnectionStackTraces}&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="testConnectionOnCheckout"&gt;
              &lt;value&gt;true&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!-- Hibernate Template Defintion --&gt;
      &lt;bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"&gt;
          &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
          &lt;property name="jdbcExceptionTranslator" ref="jdbcExceptionTranslator"/&gt;
  
      &lt;/bean&gt;
  
      &lt;!-- Spring Data Access Exception Translator Defintion --&gt;
      &lt;bean id="jdbcExceptionTranslator" class="org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator"&gt;
          &lt;property name="dataSource" ref="dataSource"/&gt;
      &lt;/bean&gt;
  
          &lt;!-- Hibernate Transaction Manager Definition --&gt;
          &lt;bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
              &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
          &lt;/bean&gt;
  
          &lt;tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/&gt;
  
          &lt;tx:advice id="txAdvice" transaction-manager="transactionManager"&gt;
              &lt;tx:attributes&gt;
                  &lt;tx:method name="get" read-only="true"/&gt;
                  &lt;tx:method name="*"/&gt;
              &lt;/tx:attributes&gt;
          &lt;/tx:advice&gt;
          &lt;context:annotation-config/&gt;
          &lt;bean id="transactionProxy" abstract="true"
                class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"&gt;
              &lt;property name="transactionManager" ref="transactionManager"/&gt;
              &lt;property name="transactionAttributes"&gt;
                  &lt;props&gt;
                      &lt;prop key="get*"&gt;PROPAGATION_REQUIRED,readOnly&lt;/prop&gt;
                      &lt;prop key="save*"&gt;PROPAGATION_REQUIRED&lt;/prop&gt;
                      &lt;prop key="update*"&gt;PROPAGATION_REQUIRED&lt;/prop&gt;
                      &lt;prop key="delete*"&gt;PROPAGATION_REQUIRED&lt;/prop&gt;
                  &lt;/props&gt;
              &lt;/property&gt;
          &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>applicationContext-middleware</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"&gt;
  
      &lt;import resource="classpath:applicationContext-core.xml"/&gt;
      &lt;context:component-scan base-package="com.project.tr..middleware"/&gt;
      &lt;context:annotation-config/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>I think it fails because of propertyConfigurer in core, somehow it can't be used while imported by middleware but I didn't understand why, </p>