You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by smilingsky <ya...@gmail.com> on 2007/07/12 19:47:32 UTC

Broker Config for servicemix-jms

Hello,

Since I have a perl client to access services through servicemix-jms, I
think I need to enable Stomp access to servicemix-jms. I read the directions
of enabling the ActiveMQ broker for Stomp from
http://activemq.apache.org/stomp.html. I also find the example on
http://incubator.apache.org/servicemix/jms-binding-configuration.html. Based
on my understanding, I have my xbean.xml configuration like:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
	xmlns:jms="http://servicemix.apache.org/jms/1.0"
	xmlns:amq="http://activemq.org/config/1.0"
	xmlns:rtdemo="http://rtdemo.abacus.com/rtdemo">
	<!-- JMS POLLER - CONSUMER -->
	<jms:endpoint service="rtdemo:MyConsumer" endpoint="MyConsumer"
		targetService="rtdemo:RTDemo" targetEndpoint="Soap" role="consumer"
		defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
		destinationStyle="queue" soap="true"
		jmsProviderDestinationName="demo.com.abacus.source"
		connectionFactory="#rtdemoConnFactory" />
	<!-- JMS SENDER - PROVIDER -->
	<jms:endpoint service="rtdemo:MyProvider" endpoint="MyProvider"
		role="provider" defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
		destinationStyle="queue"
		jmsProviderDestinationName="demo.com.abacus.result"
		connectionFactory="#rtdemoConnFactory" />
	<!-- FACTORY BEAN -->
 	<bean id="rtdemoConnFactory"
		class="org.apache.activemq.ActiveMQConnectionFactory">
		<property name="brokerURL" value="tcp://localhost:61616" />
	</bean>
	<!-- BROKER BEAN -->
 	<amq:broker id="rtdemoBroker" persistent="false">
		<amq:transportConnectors>
			<amq:transportConnector uri="tcp://localhost:61616" />
			<amq:transportConnector uri="stomp://localhost:61613" />
		</amq:transportConnectors>
	</amq:broker>
</beans>

However, it seems <amq:broker> will re-create a broker "localhost" after
ConnFactory creates one. The error message is:

2007-07-12 11:34:42,543 [main           ] ERROR BrokerService                 
- Failed to start ActiveMQ JMS Message Broker. Reason:
javax.management.InstanceAlreadyExistsException:
org.apache.activemq:BrokerName=localhost,Type=Broker
javax.management.InstanceAlreadyExistsException:
org.apache.activemq:BrokerName=localhost,Type=Broker
	at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
	at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)
	at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)
	at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
	at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
	at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
	at
org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1231)
	at
org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:508)
	at org.apache.activemq.broker.BrokerService.start(BrokerService.java:394)
	at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:47)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
	at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
	at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
	at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at
org.apache.servicemix.common.xbean.AbstractXBeanServiceUnitAnalyzer.init(AbstractXBeanServiceUnitAnalyzer.java:90)
	at
org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorMojo.generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:185)
	at
org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorMojo.execute(GenerateServiceUnitDescriptorMojo.java:143)
	at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:441)
	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:382)
	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)


Any ideas on how to fix the configuration? Thanks in advance!!

-- 
View this message in context: http://www.nabble.com/Broker-Config-for-servicemix-jms-tf4069758s12049.html#a11565270
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Broker Config for servicemix-jms

Posted by smilingsky <ya...@gmail.com>.
OK, got it. Thank you very much!!


bsnyder wrote:
> 
> On 7/12/07, smilingsky <ya...@gmail.com> wrote:
>>
>> Hello,
>>
>> Since I have a perl client to access services through servicemix-jms, I
>> think I need to enable Stomp access to servicemix-jms. I read the
>> directions
>> of enabling the ActiveMQ broker for Stomp from
>> http://activemq.apache.org/stomp.html. I also find the example on
>> http://incubator.apache.org/servicemix/jms-binding-configuration.html.
>> Based
>> on my understanding, I have my xbean.xml configuration like:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns:sm="http://servicemix.apache.org/config/1.0"
>>         xmlns:jms="http://servicemix.apache.org/jms/1.0"
>>         xmlns:amq="http://activemq.org/config/1.0"
>>         xmlns:rtdemo="http://rtdemo.abacus.com/rtdemo">
>>         <!-- JMS POLLER - CONSUMER -->
>>         <jms:endpoint service="rtdemo:MyConsumer" endpoint="MyConsumer"
>>                 targetService="rtdemo:RTDemo" targetEndpoint="Soap"
>> role="consumer"
>>                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>                 destinationStyle="queue" soap="true"
>>                 jmsProviderDestinationName="demo.com.abacus.source"
>>                 connectionFactory="#rtdemoConnFactory" />
>>         <!-- JMS SENDER - PROVIDER -->
>>         <jms:endpoint service="rtdemo:MyProvider" endpoint="MyProvider"
>>                 role="provider"
>> defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>                 destinationStyle="queue"
>>                 jmsProviderDestinationName="demo.com.abacus.result"
>>                 connectionFactory="#rtdemoConnFactory" />
>>         <!-- FACTORY BEAN -->
>>         <bean id="rtdemoConnFactory"
>>                 class="org.apache.activemq.ActiveMQConnectionFactory">
>>                 <property name="brokerURL" value="tcp://localhost:61616"
>> />
>>         </bean>
>>         <!-- BROKER BEAN -->
>>         <amq:broker id="rtdemoBroker" persistent="false">
>>                 <amq:transportConnectors>
>>                         <amq:transportConnector
>> uri="tcp://localhost:61616" />
>>                         <amq:transportConnector
>> uri="stomp://localhost:61613" />
>>                 </amq:transportConnectors>
>>         </amq:broker>
>> </beans>
>>
>> However, it seems <amq:broker> will re-create a broker "localhost" after
>> ConnFactory creates one. The error message is:
>>
>> 2007-07-12 11:34:42,543 [main           ] ERROR BrokerService
>> - Failed to start ActiveMQ JMS Message Broker. Reason:
>> javax.management.InstanceAlreadyExistsException:
>> org.apache.activemq:BrokerName=localhost,Type=Broker
>> javax.management.InstanceAlreadyExistsException:
>> org.apache.activemq:BrokerName=localhost,Type=Broker
>>         at
>> com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
> 
> 
> This is because ActiveMQ is already started inside of ServiceMix. See
> conf/activemq.xml for the ActiveMQ configuration. Just add a transport
> connector for STOMP. Below is an example:
> 
> <amq:transportConnector uri="stomp://localhost:61613 />
> 
> Just add that to the <transportConnectors> element and ActiveMQ will
> provide access via STOMP on port 61613.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache Geronimo - http://geronimo.apache.org/
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Castor - http://castor.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Broker-Config-for-servicemix-jms-tf4069758s12049.html#a11566403
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Broker Config for servicemix-jms

Posted by Bruce Snyder <br...@gmail.com>.
On 7/12/07, smilingsky <ya...@gmail.com> wrote:
>
> Hello,
>
> Since I have a perl client to access services through servicemix-jms, I
> think I need to enable Stomp access to servicemix-jms. I read the directions
> of enabling the ActiveMQ broker for Stomp from
> http://activemq.apache.org/stomp.html. I also find the example on
> http://incubator.apache.org/servicemix/jms-binding-configuration.html. Based
> on my understanding, I have my xbean.xml configuration like:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:sm="http://servicemix.apache.org/config/1.0"
>         xmlns:jms="http://servicemix.apache.org/jms/1.0"
>         xmlns:amq="http://activemq.org/config/1.0"
>         xmlns:rtdemo="http://rtdemo.abacus.com/rtdemo">
>         <!-- JMS POLLER - CONSUMER -->
>         <jms:endpoint service="rtdemo:MyConsumer" endpoint="MyConsumer"
>                 targetService="rtdemo:RTDemo" targetEndpoint="Soap" role="consumer"
>                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>                 destinationStyle="queue" soap="true"
>                 jmsProviderDestinationName="demo.com.abacus.source"
>                 connectionFactory="#rtdemoConnFactory" />
>         <!-- JMS SENDER - PROVIDER -->
>         <jms:endpoint service="rtdemo:MyProvider" endpoint="MyProvider"
>                 role="provider" defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>                 destinationStyle="queue"
>                 jmsProviderDestinationName="demo.com.abacus.result"
>                 connectionFactory="#rtdemoConnFactory" />
>         <!-- FACTORY BEAN -->
>         <bean id="rtdemoConnFactory"
>                 class="org.apache.activemq.ActiveMQConnectionFactory">
>                 <property name="brokerURL" value="tcp://localhost:61616" />
>         </bean>
>         <!-- BROKER BEAN -->
>         <amq:broker id="rtdemoBroker" persistent="false">
>                 <amq:transportConnectors>
>                         <amq:transportConnector uri="tcp://localhost:61616" />
>                         <amq:transportConnector uri="stomp://localhost:61613" />
>                 </amq:transportConnectors>
>         </amq:broker>
> </beans>
>
> However, it seems <amq:broker> will re-create a broker "localhost" after
> ConnFactory creates one. The error message is:
>
> 2007-07-12 11:34:42,543 [main           ] ERROR BrokerService
> - Failed to start ActiveMQ JMS Message Broker. Reason:
> javax.management.InstanceAlreadyExistsException:
> org.apache.activemq:BrokerName=localhost,Type=Broker
> javax.management.InstanceAlreadyExistsException:
> org.apache.activemq:BrokerName=localhost,Type=Broker
>         at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)


This is because ActiveMQ is already started inside of ServiceMix. See
conf/activemq.xml for the ActiveMQ configuration. Just add a transport
connector for STOMP. Below is an example:

<amq:transportConnector uri="stomp://localhost:61613 />

Just add that to the <transportConnectors> element and ActiveMQ will
provide access via STOMP on port 61613.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/