title: bitronix transaction manager
body: <p>I'm trying to migrate from JPA to JTA and use bitronix transaction manager. I'm getting below error message when try to run unit tests. According to bitronix documentation this is normal b/c my spring context configuration is trying to load the resources twice (once in base class and then in the test class, see code below), I have tried the same with atomikos and I got similar result.  </p>
  
  <blockquote>
    <p>Caused by:
    java.lang.IllegalArgumentException:
    resource with uniqueName 'xyzDb'
    has already been registered</p>
  </blockquote>
  
  <p>My base class</p>
  
  <pre><code>@ContextConfiguration(locations = {"classpath:com/xyz/baseContext.xml"})
  @Transactional
  public abstract class AbstractTestSupport extends Assert implements ApplicationContextAware
  {
  </code></pre>
  
  <p>In some unit tests I have to extend the test support and add a context config file like below. so it loads context once for base class and another time for child class and fails</p>
  
  <p>Child class</p>
  
  <pre><code>@ContextConfiguration(locations = {"classpath:com/xyz/testContext.xml"})
  public class UnitTest extends AbstractTestSupport
  {
  </code></pre>
  
  <p>After the test I'm shutting down context, so next test works fine as long as it doesn't extend the base class with another context config file.</p>
  
  <pre><code>@AfterClass
  public static void onTearDownAfterClass() throws Exception
  {
      applicationContext.shutdownApplicationContext();
      assertFalse("Spring application context is still active after shutdown. ", applicationContext.isActive());
  }
  </code></pre>
  
  <p>I want to keep context config files in the child classes and make this work like that, any ideas greatly appreciated....</p>