activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Travers Snyman <travers.sny...@epiuse.com>
Subject Re: Unable to configure embedded broker activemq 5.3.x
Date Mon, 10 May 2010 07:07:03 GMT

Hi,

It seems my problem is with shutting down the broker. While running a test
suite (spring integration tests), Activemq broker does not shut down after
each test causing the lock. I also find in debugging with jetty and running
with Tomcat the same behaviour when shutting down, the broker still lives
on. I actually have to kill the java process manually to stop the broker. Is
there any setting in the configuration I have missed to get the broker to
shutdown ?


Gary Tully wrote:
> 
> see:
> http://activemq.apache.org/how-do-i-turn-off-creating-an-embedded-activemq-broker-when-using-the-vm-transport.html
> 
> On 6 May 2010 15:16, Travers Snyman <travers.snyman@epiuse.com> wrote:
> 
>>
>> Hi Dejan,
>> The osgi dependency in the pom did the trick. It however seems the
>> connection factory starts before the broker is started completely. It
>> gets
>> stuck running a test suite with the following:
>>
>> WARN [main] AMQPersistenceAdapter.lock(1036) | Waiting to Lock the Store
>> d:\activemq\data
>> 06 May 2010 4:09:14 PM net.sf.ehcache.util.UpdateChecker checkForUpdate
>> WARNING: Update check failed: java.net.ConnectException: Connection timed
>> out: connect
>>
>> My connection and jms config as follows. I believe there was a waitBefore
>> start property in 5.2. Can you suggest any other config changes to the
>> below
>> ?
>>
>>
>>        <!--  create an embedded ActiveMQ Broker -->
>>          <amq:broker id="jmsBroker" brokerName="glims-broker"
>> start="true"
>> useJmx="false" persistent="true">
>>
>>                 <amq:persistenceAdapter>
>>                    <amq:amqPersistenceAdapter
>> directory="d:\activemq\data"
>>                        maxFileLength="32mb"/>
>>                 </amq:persistenceAdapter>
>>
>>                  <amq:transportConnectors>
>>                    <amq:transportConnector uri="tcp://localhost:61616"/>
>>                  </amq:transportConnectors>
>>
>>        </amq:broker>
>>
>>         <amq:connectionFactory id="jmsFactory"
>> brokerURL="vm://glims-broker"/>
>>
>>
>>
>>
>> Dejan Bosanac wrote:
>> >
>> > Hi,
>> >
>> > just tested it
>> >
>> > this should be enough
>> >
>> > <dependency>
>> >   <groupId>org.apache.activemq</groupId>
>> >   <artifactId>activemq-core</artifactId>
>> >   <version>5.3.1</version>
>> > </dependency>
>> > <dependency>
>> >   <groupId>org.springframework</groupId>
>> >   <artifactId>spring</artifactId>
>> >   <version>2.5.6</version>
>> > </dependency>
>> > <dependency>
>> >   <groupId>org.apache.xbean</groupId>
>> >   <artifactId>xbean-spring</artifactId>
>> >   <version>3.6</version>
>> > </dependency>
>> >
>> > to include a broker. The osgi should be included in the classpath as
>> > ActiveMQ dependency. If it is not, add it such as
>> >
>> >     <dependency>
>> >       <groupId>org.osgi</groupId>
>> >       <artifactId>org.osgi.core</artifactId>
>> >       <version>4.1.0</version>
>> >     </dependency>
>> >
>> > Cheers
>> > --
>> > Dejan Bosanac - http://twitter.com/dejanb
>> >
>> > Open Source Integration - http://fusesource.com/
>> > ActiveMQ in Action - http://www.manning.com/snyder/
>> > Blog - http://www.nighttale.net
>> >
>> >
>> > On Thu, May 6, 2010 at 10:09 AM, Travers Snyman
>> > <travers.snyman@epiuse.com>wrote:
>> >
>> >>
>> >> Yes I have tried this with 5.3.1 and get the same error
>> >>
>> >> Instantiation of bean failed; nested exception is org.springf
>> >> ramework.beans.BeanInstantiationException: Could not instantiate bean
>> >> class
>> >> [org.apache.activemq.xbean.XBeanBrokerService]: Constructor threw
>> >> exception;
>> >> nested exception is java.lang.NoClassDefFoundError:
>> >> org/osgi/framework/BundleException
>> >>        at
>> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
>> >>        at
>> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
>> >>        at
>> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
>> >>        at
>> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
>> >>        at java.security.AccessController.doPrivileged(Native Method)
>> >>        at
>> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
>> >>        at
>> >>
>> >>
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
>> >>        at
>> >>
>> >>
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>> >>
>> >> Dejan Bosanac wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > can you try
>> >> >
>> >> >       <dependency>
>> >> >            <groupId>org.apache.activemq</groupId>
>> >> >            <artifactId>activemq-all</artifactId>
>> >> >            <version>5.3.1</version>
>> >> >        </dependency>
>> >> >
>> >> > Cheers
>> >> > --
>> >> > Dejan Bosanac - http://twitter.com/dejanb
>> >> >
>> >> > Open Source Integration - http://fusesource.com/
>> >> > ActiveMQ in Action - http://www.manning.com/snyder/
>> >> > Blog - http://www.nighttale.net
>> >> >
>> >> >
>> >> > On Thu, May 6, 2010 at 9:11 AM, Travers Snyman
>> >> > <travers.snyman@epiuse.com>wrote:
>> >> >
>> >> >>
>> >> >> I am unable to get the right configuration for an embedded broker
>> to
>> >> >> start
>> >> >> configuring with spring.
>> >> >>
>> >> >> In my pom.xml I have the following dependancy for activemq
>> >> >>       <dependency>
>> >> >>            <groupId>org.apache.activemq</groupId>
>> >> >>            <artifactId>activemq-core</artifactId>
>> >> >>            <version>5.3.2</version>
>> >> >>        </dependency>
>> >> >>
>> >> >> My Jms-context.xml contains the following for the broker
>> >> >>
>> >> >>        <!--  create an embedded ActiveMQ Broker -->
>> >> >>         <amq:broker brokerName="glims-broker" start="true"
>> >> useJmx="false"
>> >> >> persistent="true">
>> >> >>
>> >> >>                 <amq:persistenceAdapter>
>> >> >>                    <amq:amqPersistenceAdapter
>> >> >> directory="d:\activemq\data"
>> >> >>                        maxFileLength="32mb"/>
>> >> >>                 </amq:persistenceAdapter>
>> >> >>
>> >> >>                  <amq:transportConnectors>
>> >> >>                    <amq:transportConnector
>> >> uri="tcp://localhost:61616"/>
>> >> >>                  </amq:transportConnectors>
>> >> >>
>> >> >>        </amq:broker>
>> >> >>
>> >> >> I get the following exception when building:
>> >> >>
>> >> >>
>> >> >> Project ID: null:geronimo-j2ee-management_1.0_spec:jar:1.0
>> >> >>
>> >> >> Reason: Cannot find parent: org.apache.geronimo.specs:specs for
>> >> project:
>> >> >> null:geronimo-j2ee-management_1.0_spec:jar:1.0 for project
>> >> >> null:geronimo-j2ee-management_1.0_spec:jar:1.0
>> >> >>
>> >> >> I also tried with activemq-all in the pom instead of activemq-core
>> >> >>
>> >> >>        ... 21 more
>> >> >> Caused by: org.springframework.beans.BeanInstantiationException:
>> Could
>> >> >> not
>> >> >> instantiate bean class
>> [org.apache.activemq.xbean.XBeanBrokerService]:
>> >> >> Constructor threw exception; nested exception is
>> >> >> java.lang.NoClassDefFoundError: org/osgi/framework/BundleException
>> >> >>        at
>> >> >>
>> >>
>> org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
>> >> >>        at
>> >> >>
>> >> >>
>> >>
>> org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
>> >> >>        at
>> >> >>
>> >> >>
>> >>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
>> >> >>        ... 38 more
>> >> >> Caused by: java.lang.NoClassDefFoundError:
>> >> >> org/osgi/framework/BundleException
>> >> >>        at
>> >> >>
>> >> >>
>> >>
>> org.apache.activemq.xbean.XBeanBrokerService.<init>(XBeanBrokerService.java:57)
>> >> >>        at
>> >> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> >> >> Method)
>> >> >>        at
>> >> >>
>> >> >>
>> >>
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>> >> >>        at
>> >> >>
>> >> >>
>> >>
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>> >> >>        at
>> >> java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>> >> >>
>> >> >> I am at a loss as to the configuration. Do I need other
>> dependencies
>> >> in
>> >> >> the
>> >> >> pom ?
>> >> >>
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://old.nabble.com/Unable-to-configure-embedded-broker-activemq-5.3.x-tp28470056p28470056.html
>> >> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > -----
>> >> > Dejan Bosanac
>> >> >
>> >> > Open Source Integration - http://fusesource.com/
>> >> > ActiveMQ in Action - http://www.manning.com/snyder/
>> >> > Blog - http://www.nighttale.net
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://old.nabble.com/Unable-to-configure-embedded-broker-activemq-5.3.x-tp28470056p28470468.html
>> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > -----
>> > Dejan Bosanac
>> >
>> > Open Source Integration - http://fusesource.com/
>> > ActiveMQ in Action - http://www.manning.com/snyder/
>> > Blog - http://www.nighttale.net
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Unable-to-configure-embedded-broker-activemq-5.3.x-tp28470056p28474278.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 
> 

-- 
View this message in context: http://old.nabble.com/Unable-to-configure-embedded-broker-activemq-5.3.x-tp28470056p28508331.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message