title: Spring 3.2.3 : activemq 5.5 dependency problems
body: <p>I'm trying to upgrade a project to spring 3.2.3, from spring 3.0.7.  I'm currently stuck on a problem with activemq dependencies and can't figure out what jar I need or is conflicting in the first place.  The following is my stacktrace</p>
  
  <blockquote>
    <p>org.unitils.core.UnitilsException: Unable to create application
    context for locations [classpath:producerServiceContext-test.xml]     at
    org.unitils.spring.util.ApplicationContextManager.createInstanceForValues(ApplicationContextManager.java:121)
      at
    org.unitils.spring.util.ApplicationContextManager.createInstanceForValues(ApplicationContextManager.java:36)
      at
    org.unitils.core.util.AnnotatedInstanceManager.getInstanceImpl(AnnotatedInstanceManager.java:234)
      at
    org.unitils.core.util.AnnotatedInstanceManager.getInstance(AnnotatedInstanceManager.java:121)
      at
    org.unitils.spring.util.ApplicationContextManager.getApplicationContext(ApplicationContextManager.java:65)
      at
    org.unitils.spring.SpringModule.getApplicationContext(SpringModule.java:235)
      at
    org.unitils.spring.SpringModule$1.isApplicableFor(SpringModule.java:108)
      at
    org.unitils.database.transaction.impl.DefaultUnitilsTransactionManager.getTransactionManagementConfiguration(DefaultUnitilsTransactionManager.java:180)
      at
    org.unitils.database.transaction.impl.DefaultUnitilsTransactionManager.startTransaction(DefaultUnitilsTransactionManager.java:96)
      at
    org.unitils.database.DatabaseModule.startTransaction(DatabaseModule.java:410)
      at
    org.unitils.database.DatabaseModule.startTransactionForTestMethod(DatabaseModule.java:381)
      at
    org.unitils.database.DatabaseModule$DatabaseTestListener.beforeTestSetUp(DatabaseModule.java:535)
      at
    org.unitils.core.Unitils$UnitilsTestListener.beforeTestSetUp(Unitils.java:273)
      at
    org.unitils.UnitilsJUnit4TestClassRunner$TestListenerInvokingMethodRoadie.runBeforesThenTestThenAfters(UnitilsJUnit4TestClassRunner.java:151)
      at
    org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
      at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
      at
    org.unitils.UnitilsJUnit4TestClassRunner.invokeTestMethod(UnitilsJUnit4TestClassRunner.java:95)
      at
    org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:61)
      at
    org.unitils.UnitilsJUnit4TestClassRunner.access$000(UnitilsJUnit4TestClassRunner.java:44)
      at
    org.unitils.UnitilsJUnit4TestClassRunner$1.run(UnitilsJUnit4TestClassRunner.java:62)
      at
    org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
      at
    org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
      at
    org.unitils.UnitilsJUnit4TestClassRunner.run(UnitilsJUnit4TestClassRunner.java:68)
      at
    org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at
    org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at
    org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at
    org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at
    org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at
    org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    Caused by: org.springframework.beans.factory.BeanCreationException:
    Error creating bean with name
    'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path
    resource [producerServiceContext-test.xml]: Initialization of bean
    failed; nested exception is java.lang.NoSuchFieldError: NULL  at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)
      at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
      at
    org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
      at
    org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
      at
    org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
      at
    org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      at
    org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
      at
    org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
      at
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
      at
    org.unitils.spring.util.ApplicationContextManager.createInstanceForValues(ApplicationContextManager.java:117)
      ... 28 more Caused by: java.lang.NoSuchFieldError: NULL     at
    org.springframework.expression.TypedValue.(TypedValue.java:32)
      at
    org.springframework.expression.spel.support.StandardEvaluationContext.setRootObject(StandardEvaluationContext.java:88)
      at
    org.springframework.expression.spel.support.StandardEvaluationContext.(StandardEvaluationContext.java:74)
      at
    org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:124)
      at
    org.springframework.beans.factory.support.AbstractBeanFactory.evaluateBeanDefinitionString(AbstractBeanFactory.java:1312)
      at
    org.springframework.beans.factory.support.BeanDefinitionValueResolver.evaluate(BeanDefinitionValueResolver.java:225)
      at
    org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:201)
      at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387)
      at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128)
      at
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      ... 37 more</p>
  </blockquote>
  
  <p>The following are my activemq pom dependencies</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
          &lt;artifactId&gt;activemq-core&lt;/artifactId&gt;
          &lt;version&gt;5.5.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
          &lt;artifactId&gt;activemq-pool&lt;/artifactId&gt;
          &lt;version&gt;5.5.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Furthermore I'm using the distribution bundle of spring 3.2.3.  I like to avoid copy pasting that one here since it are quite some dependencies and I rather keep this concise and to the point.  </p>
  
  <p>this is my applicationcontext that won't load up</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
    http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"&gt;
  
      &lt;!--  lets create an embedded ActiveMQ Broker --&gt;
      &lt;amq:broker useJmx="false" persistent="false"&gt;
          &lt;amq:transportConnectors&gt;
              &lt;amq:transportConnector uri="tcp://localhost:0" /&gt;
          &lt;/amq:transportConnectors&gt;
      &lt;/amq:broker&gt;
  
      &lt;!--  ActiveMQ destinations to use  --&gt;
      &lt;amq:queue id="destination" physicalName="org.apache.activemq.spring.Test.spring.embedded" /&gt;
  
      &lt;!-- JMS ConnectionFactory to use, configuring the embedded broker using XML --&gt;
      &lt;amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost?broker.persistent=false" /&gt;
  
  
      &lt;!-- Spring JMS Template --&gt;
      &lt;bean id="fastJmsTemplate" class="org.springframework.jms.core.JmsTemplate"&gt;
          &lt;property name="connectionFactory"&gt;
              &lt;!-- lets wrap in a pool to avoid creating a connection per send --&gt;
              &lt;bean class="org.springframework.jms.connection.SingleConnectionFactory"&gt;
                  &lt;property name="targetConnectionFactory"&gt;
                      &lt;ref local="jmsFactory" /&gt;
                  &lt;/property&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="consumerJmsTemplate" class="org.springframework.jms.core.JmsTemplate"&gt;
          &lt;property name="connectionFactory" ref="jmsFactory" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="fastJmsProducer" class="com.emakina.truvo.ssls.fast.service.util.FastJmsProducer"&gt;
          &lt;property name="template"&gt;
              &lt;ref bean="fastJmsTemplate"&gt;&lt;/ref&gt;
          &lt;/property&gt;
  
          &lt;property name="destination"&gt;
              &lt;ref bean="destination" /&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="consumer" class="com.emakina.truvo.ssls.fast.service.util.SimpleFastJmsConsumer"&gt;
          &lt;property name="template" ref="consumerJmsTemplate" /&gt;
          &lt;property name="destination" ref="destination" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>If anyone came across the same integration problem I would really appreciate some feedback.</p>