activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C. Ullenboom" <cafeb...@java-tutor.com>
Subject ActiveMQ and Spring: configuration has no BrokerService
Date Mon, 15 May 2006 20:35:58 GMT

I’m using Spring and ActiveMQ and the BrokerService is working fine with

<bean id="broker" class="org.apache.activemq.broker.BrokerService"
init-method="start">
  <property name="persistent" value="false"/>
  <property name="transportConnectorURIs">
    <list>
     <value>http://localhost:61616</value>
    </list>
  </property>
 </bean>

But when I want to use the BrokerFactoryBean

<bean id="broker"
	class="org.apache.activemq.xbean.BrokerFactoryBean">
	<property name="config" value="classpath:broker.xml" />
	<property name="start" value="true" />
</bean>

with this config

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC  "-//ACTIVEMQ//DTD//EN"
"http://activemq.org/dtd/activemq.dtd">
<beans>

	<broker>
		<connector>
			<tcpServerTransport uri="tcp://localhost:61616"
				backlog="false" />
		</connector>

		<persistence>
			<vmPersistence />
		</persistence>
	</broker>

</beans>

I get an exception.

Exception in thread "main"
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'broker' defined in class path resource [ctx.xml]: Initialization
of bean failed; nested exception is java.lang.IllegalArgumentException: The
configuration has no BrokerService instance for resource: class path
resource [broker.xml]
java.lang.IllegalArgumentException: The configuration has no BrokerService
instance for resource: class path resource [broker.xml]
	at
org.apache.activemq.xbean.BrokerFactoryBean.afterPropertiesSet(BrokerFactoryBean.java:97)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
	at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
	at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
	at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
	at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:63)
	at Main.main(Main.java:15)


My understanding was that the BrokerFactoryBean is configuring this
BrokerService. Why is it complaining?

 Christian

--
View this message in context: http://www.nabble.com/ActiveMQ-and-Spring%3A-configuration-has-no-BrokerService-t1623411.html#a4398696
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message