yep, this is expected when using the spring test functionality. your subclass will inherit the config from parent class which also loads a broker. take a look at link below to turn off inheritance:
@ContextConfiguration(inheritLocations=false) http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/test/context/ContextConfiguration.html On Tue, Jun 4, 2013 at 9:29 AM, <guillaume.sur...@orange.com> wrote: > Hi,**** > > ** ** > > I’m stuck with a problem using spring configuration of an ActiveMQ broker. > The broker seems to be created 2 times, causing a JMX exception the second > time when the beans are registered: > javax.management.InstanceAlreadyExistsException: > org.apache.activemq:type=Broker,brokerName=localhost**** > > ** ** > > Here is my setup:**** > > I’ve got a test class which uses an embedded broker (created using spring > configuration). Another test class extends this one to run these tests with > another spring configuration which includes some changes.**** > > ** ** > > I’ve reproduced the problem on a minimal project attached. I’m running on > jdk1.6.0_45. Is this a known bug or a misconfiguration ?**** > > ** ** > > Thanks,**** > > Guillaume**** > > _________________________________________________________________________________________________________________________ > > Ce message et ses pieces jointes peuvent contenir des informations > confidentielles ou privilegiees et ne doivent donc > pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu > ce message par erreur, veuillez le signaler > a l'expediteur et le detruire ainsi que les pieces jointes. Les messages > electroniques etant susceptibles d'alteration, > France Telecom - Orange decline toute responsabilite si ce message a ete > altere, deforme ou falsifie. Merci. > > This message and its attachments may contain confidential or privileged > information that may be protected by law; > they should not be distributed, used or copied without authorisation. > If you have received this email in error, please notify the sender and delete > this message and its attachments. > As emails may be altered, France Telecom - Orange is not liable for messages > that have been modified, changed or falsified. > Thank you. > > -- *Christian Posta* http://www.christianposta.com/blog twitter: @christianposta