activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonas Lim" <j...@exist.com>
Subject Re: Broker Starts, Stops...
Date Thu, 11 May 2006 06:09:02 GMT
Hi,

It appears to be a valid output.   Unless you have any processing done after 
calling the broker.start() method, the main thread will exit.   You can try 
adding a  sort of shutdown hook to prevent the main thread from exiting 
(unless it is terminated elsewhere)  after calling start().

Regards,
Jonas




----- Original Message ----- 
From: "kitplummer" <kitplummer@gmail.com>
To: <activemq-users@geronimo.apache.org>
Sent: Thursday, May 11, 2006 12:25 PM
Subject: Broker Starts, Stops...


>
> I've setup some code to start a broker, from a xbeans config file.  The
> broker starts fine, reading the config from the xml file.  But, it stops
> itself right away.  Can anybody point the problem out to me?
>
> Here's the code:
>
> try {
>  BrokerService broker = (new XBeanBrokerFactory()).createBroker(new
> URI("xbean:eMAF_Broker.xml"));
>  broker.start();
> } catch (Exception e) {
>  e.printStackTrace();
> }
>
> Here's the config:
>
> <beans xmlns="http://activemq.org/config/1.0">
>  <broker useJmx="false">
> <!-- In ActiveMQ 4, you can setup destination policies -->
>    <destinationPolicy>
>      <policyMap><policyEntries>
>
>          <policyEntry topic="eMAF.LI.MCStatus">
>            <dispatchPolicy>
>              <strictOrderDispatchPolicy />
>            </dispatchPolicy>
>            <subscriptionRecoveryPolicy>
>              <lastImageSubscriptionRecoveryPolicy />
>            </subscriptionRecoveryPolicy>
>          </policyEntry>
>
>      </policyEntries></policyMap>
>    </destinationPolicy>
>
>
>    <persistenceAdapter>
>      <journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data"/>
>    </persistenceAdapter>
>
>    <transportConnectors>
>       <transportConnector name="default" uri="tcp://localhost:61616"
> discoveryUri="multicast://default"/>
>    </transportConnectors>
>
>    <networkConnectors>
>      <!-- by default just auto discover the other brokers -->
>      <networkConnector name="default" uri="multicast://default"/>
>    </networkConnectors>
>
>  </broker>
>
> </beans>
>
> And the output:
>
> May 10, 2006 9:23:20 PM com.raytheon.ap.emaf.comm.CommContainer start
> INFO: Starting CommContainer...
> May 10, 2006 9:23:20 PM com.raytheon.ap.emaf.comm.Broker start
> INFO: Starting Broker...
> May 10, 2006 9:23:20 PM
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource
> [eMAF_Broker.xml]
> May 10, 2006 9:23:21 PM
> org.springframework.context.support.AbstractRefreshableApplicationContext
> refreshBeanFactory
> INFO: Bean factory for application context
> [org.apache.xbean.spring.context.ClassPathXmlApplicationContext;hashCode=16094127]:
> org.springframework.beans.factory.support.DefaultListableBeanFactory
> defining beans [org.apache.activemq.xbean.XBeanBrokerService]; root of
> BeanFactory hierarchy
> May 10, 2006 9:23:21 PM
> org.springframework.context.support.AbstractApplicationContext refresh
> INFO: 1 beans defined in application context
> [org.apache.xbean.spring.context.ClassPathXmlApplicationContext;hashCode=16094127]
> May 10, 2006 9:23:21 PM org.springframework.core.CollectionFactory 
> <clinit>
> INFO: JDK 1.4+ collections available
> May 10, 2006 9:23:21 PM
> org.springframework.context.support.AbstractApplicationContext
> initMessageSource
> INFO: Unable to locate MessageSource with name 'messageSource': using
> default 
> [org.springframework.context.support.DelegatingMessageSource@87cd5c]
> May 10, 2006 9:23:21 PM
> org.springframework.context.support.AbstractApplicationContext
> initApplicationEventMulticaster
> INFO: Unable to locate ApplicationEventMulticaster with name
> 'applicationEventMulticaster': using default
> [org.springframework.context.event.SimpleApplicationEventMulticaster@3f5841]
> May 10, 2006 9:23:21 PM
> org.springframework.beans.factory.support.DefaultListableBeanFactory
> preInstantiateSingletons
> INFO: Pre-instantiating singletons in factory
> [org.springframework.beans.factory.support.DefaultListableBeanFactory
> defining beans [org.apache.activemq.xbean.XBeanBrokerService]; root of
> BeanFactory hierarchy]
> May 10, 2006 9:23:21 PM
> org.springframework.beans.factory.support.AbstractBeanFactory getBean
> INFO: Creating shared instance of singleton bean
> 'org.apache.activemq.xbean.XBeanBrokerService'
> May 10, 2006 9:23:22 PM org.apache.activemq.broker.BrokerService getBroker
> INFO: ActiveMQ 4.0-RC2 JMS Message Broker (localhost) is starting
> May 10, 2006 9:23:22 PM org.apache.activemq.broker.BrokerService getBroker
> INFO: For help or more information please see:
> http://incubator.apache.org/activemq/
> May 10, 2006 9:23:24 PM
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter createAdapter
> INFO: Database driver recognized: [apache_derby_embedded_jdbc_driver]
> May 10, 2006 9:23:26 PM
> org.apache.activemq.store.journal.JournalPersistenceAdapter recover
> INFO: Journal Recovery Started from: Active Journal: using 5 x 20.0 Megs 
> at:
> /Users/kplummer/Documents/workspace/activemq-data/journal
> May 10, 2006 9:23:26 PM
> org.apache.activemq.store.journal.JournalPersistenceAdapter recover
> INFO: Journal Recovered: 0 message(s) in transactions recovered.
> May 10, 2006 9:23:26 PM
> org.apache.activemq.transport.TransportServerThreadSupport doStart
> INFO: Listening for connections at: tcp://katetop.local:61616
> May 10, 2006 9:23:26 PM
> org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent
> start
> WARNING: brokerName not set
> May 10, 2006 9:23:26 PM org.apache.activemq.broker.TransportConnector 
> start
> INFO: Connector default Started
> May 10, 2006 9:23:26 PM org.apache.activemq.network.NetworkConnector 
> doStart
> INFO: Network Connector default Started
> May 10, 2006 9:23:26 PM org.apache.activemq.broker.BrokerService start
> INFO: ActiveMQ JMS Message Broker (localhost) started
> May 10, 2006 9:23:26 PM org.apache.activemq.broker.BrokerService stop
> INFO: ActiveMQ Message Broker (localhost) is shutting down
>
> Help please?
>
> TIA,
> Kit
> --
> View this message in context: 
> http://www.nabble.com/Broker-Starts%2C-Stops...-t1598162.html#a4334252
> Sent from the ActiveMQ - User forum at Nabble.com. 


Mime
View raw message